]> Savannah Git Hosting - gnulib.git/commit
strnlen: avoid undefined memcmp behavior
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 30 Jun 2024 10:27:48 +0000 (11:27 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 30 Jun 2024 22:28:19 +0000 (00:28 +0200)
commit0470e006902d60747e8f659a55c815792159e2d5
tree523da40ecf1906ffd847e69641dc937f62bbd97d
parent05fbc5877488cc2c322291f22c89147e6e917238
strnlen: avoid undefined memcmp behavior

Problem reported by Po Lu in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00288.html
* config/srclist.txt: Don’t mention strnlen.c even in a comment,
as the Gnulib and glibc implementations have diverged for
portability reasons, and they’re never likely to merge.
* lib/strnlen.c (strnlen): Avoid undefined behavior if
the array S points to has fewer than MAXLEN bytes.
ChangeLog
config/srclist.txt
lib/strnlen.c