Attention is currently required from: 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 2:
(1 comment)
File src/commonlib/bsd/string.c:
https://review.coreboot.org/c/coreboot/+/83914/comment/d31851b5_ff314f06?usp... :
PS1, Line 19: str + maxlen + 1
Hmm... […]
Upon closer inspection, my suggestion had the same problem of dereferencing one more byte than intended. It's kind of tricky to resolve that while keeping the `*ptr++` intact and still having the exit calculation right in all cases. Best I could come up with was split the exit into two cases: see CB:83933 for my new suggestion.
--
To view, visit
https://review.coreboot.org/c/coreboot/+/83914?usp=email
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ic9d983b11391f5e05c2bceb262682aced5206f94
Gerrit-Change-Number: 83914
Gerrit-PatchSet: 2
Gerrit-Owner: Yu-Ping Wu
yupingso@google.com
Gerrit-Reviewer: Julius Werner
jwerner@chromium.org
Gerrit-Reviewer: Karthik Ramasubramanian
kramasub@google.com
Gerrit-Reviewer: Mario Scheithauer
mario.scheithauer@siemens.com
Gerrit-Reviewer: Maximilian Brune
maximilian.brune@9elements.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-Attention: Yu-Ping Wu
yupingso@google.com
Gerrit-Comment-Date: Thu, 15 Aug 2024 20:50:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Julius Werner
jwerner@chromium.org
Comment-In-Reply-To: Yu-Ping Wu
yupingso@google.com