mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
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>
This commit is contained in:
parent
cd379a2dc8
commit
cc7ed26934
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue