From e28fa4049d6a9c584bdf499fbaee2ee459b40118 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Thu, 14 Feb 2019 11:19:07 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/31494 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner Reviewed-by: Furquan Shaikh --- util/cbfstool/cbfs_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 6ccc4f904e..5ff81309f4 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -1844,7 +1844,7 @@ struct cbfs_file_attribute *cbfs_file_next_attr(struct cbfs_file *file, /* Is there enough space for another attribute? */ if ((uint8_t *)attr + ntohl(attr->len) + - sizeof(struct cbfs_file_attribute) >= + sizeof(struct cbfs_file_attribute) > (uint8_t *)file + ntohl(file->offset)) return NULL; -- cgit v1.2.3