* lib/string-desc-contains.c (string_desc_contains): Handle the case of
an empty haystack before invoking 'memmem'.
+2024-09-09 Bruno Haible <bruno@clisp.org>
+
+ string-desc: Fix undefined behaviour.
+ * lib/string-desc-contains.c (string_desc_contains): Handle the case of
+ an empty haystack before invoking 'memmem'.
+
2024-09-05 Paul Eggert <eggert@cs.ucla.edu>
Fix COPYING.EXCEPTION license notices
{
if (needle._nbytes == 0)
return 0;
+ if (haystack._nbytes == 0)
+ return -1;
void *found =
memmem (haystack._data, haystack._nbytes, needle._data, needle._nbytes);
if (found != NULL)