Attention is currently required from: Angel Pons, Light, Nikolai Artemiev. Hello build bot (Jenkins), Nico Huber, Nikolai Artemiev,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/62733
to look at the new patch set (#6).
Change subject: writeprotect_ranges.c: Check for underflow when using unsigned types ......................................................................
writeprotect_ranges.c: Check for underflow when using unsigned types
size_t is an unsigned type so bp_max-2 causes an underflow. This results in undefined behaviour. So assert before that bits->bp_bit-count > 1 so that bp_max has a minimum value of 2. But the when bp_bit_count == 0 then bp == 0 and when bp_bit_count == 1 then bp == 0 or bp == 1 == bp_max. These cases are handled seaprately so the underflow will never occur. Ignore the tool for this issue.
Change-Id: I2766ef8e34f7121dad746e5f32a835d480ae1cad Signed-off-by: Aarya Chaumal aarya.chaumal@gmail.com --- M writeprotect_ranges.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/33/62733/6