]> Savannah Git Hosting - gnulib.git/commit
strnlen: avoid undefined memcmp behavior stable-202307
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:36:53 +0000 (00:36 +0200)
commitd54dcab4cd35de01498f6b2719c3273395955b2b
tree0db7cc761466d44f6faebf4a3662a4eff81e448b
parent85afba352bfc6ab460d2387af0e40599bd769f4a
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