bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix memleak in getdelim.m4


From: Paul Eggert
Subject: Re: Fix memleak in getdelim.m4
Date: Thu, 21 May 2020 12:30:48 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/21/20 11:40 AM, Bruno Haible wrote:
-      if (memmem (haystack, 3, NULL, 0) != haystack)
+      if (memmem (haystack, 3, (const char *) 1, 0) != haystack)

This has undefined behavior in general, no? So some future sanitizer may complain about it, for good reason.

How about using '""' instead of '(const char *) 1'?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]