Attention is currently required from: Xiang Wang, Stefan Reinauer, Edward O'Callaghan. Hello build bot (Jenkins), Stefan Reinauer, Edward O'Callaghan,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/49741
to look at the new patch set (#2).
Change subject: helpers.c: Fix undefined behavior in strndup() ......................................................................
helpers.c: Fix undefined behavior in strndup()
Using strlen() or strdup() inside strndup() is problematic: if the input string is not null-terminated, these functions can read past the end of the buffer, which triggers undefined behavior. Rewrite the function to never read past the provided `maxlen` bound.
Change-Id: Id34127024085879228626fbad59af03268ec5255 Signed-off-by: Xiang Wang merle@hardenedliux.org --- M helpers.c 1 file changed, 9 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/41/49741/2