Attention is currently required from: Angel Pons, Light, Anastasia Klimchuk. Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/62764 )
Change subject: ich_descriptors.c: Ensure unsigned types >=0 on to prevent underflow ......................................................................
Patch Set 16: Code-Review+1
(1 comment)
File ich_descriptors.c:
https://review.coreboot.org/c/flashrom/+/62764/comment/79c230a2_c679301c PS14, Line 501: for (j = 0; j < (size_t)min(num_regions, 12); j++)
That was a question for Edward :) Let's wait for reply. […]
Not sure why you don't believe it is the max bounds in this case? Anastasia, the number of regions is initialised to 10 and 16 above but that isn't the *max* bound for the loop.
I am not overly concerned about the identifier name, `max_region_index` or something will do, the structure of the code is more important imho. The main thing here is that the static analyzer is alluding to a area of code that has a possibly overflow generally indicates poor structure that allows such subtle bugs to emerge.