]> 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)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 30 Jun 2024 10:28:07 +0000 (11:28 +0100)
commit65fd60c02ccb5530249affc0caefc75aa88d61fc
treea06931200b071c6ba4a8914bac77e61b9c93228c
parentffa5c25dba42cce2369ef66ee1ce6f22d7e74977
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