Attention is currently required from: Jakub Czapiga, Maximilian Brune, Yu-Ping Wu.
Julius Werner has posted comments on this change by Yu-Ping Wu. ( https://review.coreboot.org/c/coreboot/+/83914?usp=email )
Change subject: commonlib/bsd/string: Fix pointer overflow for strnlen() ......................................................................
Patch Set 1:
(1 comment)
File src/commonlib/bsd/string.c:
https://review.coreboot.org/c/coreboot/+/83914/comment/f6e714f4_ddab41ec?usp... : PS1, Line 19: str + maxlen + 1
Can we just make this `MAX(str + maxlen + 1, SIZE_MAX)`? It's not practically possible to have a str […]
edit: sorry, that was supposed to be `MIN()`, of course. Actually, neither of those is great. Hmmm... ``` if (end <= ptr) end = (void *)UINTPTR_MAX; ``` ? (That coincidentally solves the issue about the string looping around the end of the address space as well.)