bug-gnu-utils
[Top][All Lists]
Advanced

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

findutils-4.1: locate can SEGV (+fix)


From: Ken Lalonde
Subject: findutils-4.1: locate can SEGV (+fix)
Date: Thu, 9 Jan 2003 13:50:38 -0500 (EST)

The version of locate in findutils-4.1 can fail to allocate
a large enough buffer under some circumstances,
leading to a SEGV.
I can supply a tar file of directory structure that causes
the error if you need it; but inspection of the code should suffice.

Here's the fix:


--- /tmp/k/o/findutils-4.1/lib/getline.c        Fri Nov  4 10:16:50 1994
+++ ./getline.c Thu Jan  9 13:41:57 2003
@@ -77,7 +77,7 @@
         NUL-terminate the line buffer.  */
 
       assert(*n - nchars_avail == read_pos - *lineptr);
-      if (nchars_avail < 1)
+      while (nchars_avail < 1)
        {
          if (*n > MIN_CHUNK)
            *n *= 2;




reply via email to

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