diff options
author | Yaroslav K | 2016-08-08 20:32:15 -0700 |
---|---|---|
committer | Bin Meng | 2016-08-16 11:44:09 +0800 |
commit | cc7ed269341fb48b6453d013cc79ac15cb497f04 (patch) | |
tree | 961e84f9ff9f1f0986e1c63abe5f53a080eff753 /fs | |
parent | cd379a2dc892e3ea1370b313036751629395aefa (diff) |
cbfs: Fix incorrect CBFS file header size being used
This fixes incorrect filenames in cbfsls output.
Signed-off-by: Yaroslav K. <yar444@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[clean up checkpatch errors and warnings]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cbfs/cbfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index 95a48a46f53..6e1107d751b 100644 --- a/fs/cbfs/cbfs.c +++ b/fs/cbfs/cbfs.c @@ -97,8 +97,8 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align, } swap_file_header(&header, fileHeader); - if (header.offset < sizeof(const struct cbfs_cachenode *) || - header.offset > header.len) { + if (header.offset < sizeof(struct cbfs_fileheader) || + header.offset > header.len) { file_cbfs_result = CBFS_BAD_FILE; return -1; } @@ -106,9 +106,9 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align, newNode->type = header.type; newNode->data = start + header.offset; newNode->data_length = header.len; - name_len = header.offset - sizeof(struct cbfs_cachenode *); + name_len = header.offset - sizeof(struct cbfs_fileheader); newNode->name = (char *)fileHeader + - sizeof(struct cbfs_cachenode *); + sizeof(struct cbfs_fileheader); newNode->name_length = name_len; newNode->checksum = header.checksum; |