Jacob Garber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/30409 )
Change subject: Fix -Wsign-compare trouble ......................................................................
Patch Set 5:
(5 comments)
https://review.coreboot.org/c/flashrom/+/30409/5/cbtable.c File cbtable.c:
https://review.coreboot.org/c/flashrom/+/30409/5/cbtable.c@43 PS5, Line 43: image + size - 0x10 I think this parses as (image + size) - 0x10, right?
https://review.coreboot.org/c/flashrom/+/30409/5/cbtable.c@51 PS5, Line 51: image + size - 0x80 Ditto
https://review.coreboot.org/c/flashrom/+/30409/5/cbtable.c@69 PS5, Line 69: image + size - mb_part_offset Ditto
https://review.coreboot.org/c/flashrom/+/30409/5/cbtable.c@70 PS5, Line 70: image + size - mb_vendor_offset Ditto
https://review.coreboot.org/c/flashrom/+/30409/5/fmap.c File fmap.c:
https://review.coreboot.org/c/flashrom/+/30409/5/fmap.c@99 PS5, Line 99: (len - sizeof(struct fmap))
Not sure anymore why I placed the parentheses. It looks like it would be […]
If len < sizeof(struct fmap), we could just do an early return -2, so there's no problem of overflow then.