cbfstool: Fix cbfs_file_next_attr

The last attribute was never returned.
Fix size compare to retrieve all attributes.

Manually tested and seen all attributes, including the last one.

Change-Id: I08df073158a0f285f96048c92aa8066fa4f57e6f
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31494
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Patrick Rudolph 2019-02-14 11:19:07 +01:00 committed by Patrick Georgi
parent 19fcc89fe0
commit e28fa4049d
1 changed files with 1 additions and 1 deletions

View File

@ -1844,7 +1844,7 @@ struct cbfs_file_attribute *cbfs_file_next_attr(struct cbfs_file *file,
/* Is there enough space for another attribute? */ /* Is there enough space for another attribute? */
if ((uint8_t *)attr + ntohl(attr->len) + if ((uint8_t *)attr + ntohl(attr->len) +
sizeof(struct cbfs_file_attribute) >= sizeof(struct cbfs_file_attribute) >
(uint8_t *)file + ntohl(file->offset)) (uint8_t *)file + ntohl(file->offset))
return NULL; return NULL;