[PATCH] D139449: [ObjYAML] Pass 10 instead of 16 for strncmp
Alf via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 10 09:09:41 PST 2022
gAlfonso-bit reclaimed this revision.
gAlfonso-bit added a comment.
Actually, it is undefined behavior to over-read when we know __LINKEDIT is 11 characters long. According to the C-standard, strncmp will stop when either string has a NULL terminator. So, even in the cases where segname has no terminator, we should stop at 10 anyway, because anything longer than the end of the string literal is undefined behavior.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139449/new/
https://reviews.llvm.org/D139449
More information about the llvm-commits
mailing list