bug-findutils
[Top][All Lists]
Advanced

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

Re: findutils-4.1 locate crashing


From: David Newall
Subject: Re: findutils-4.1 locate crashing
Date: Sat, 17 Apr 2004 03:33:00 +0930

Dear Findutils maintainer,

I would like to submit a patch for the problem which Steve Murphy
reported a couple of years ago (locate crashes on long file names.)  The
problem occurs when getstr() is called with offset significantly greater
than the the buffer size.

Regards,

David Newall

diff -u -r findutils-4.1.orig/lib/getline.c findutils-4.1/lib/getline.c
--- findutils-4.1.orig/lib/getline.c    2004-04-17 03:23:31 +0930
+++ findutils-4.1/lib/getline.c 2004-04-17 03:26:00 +0930
@@ -79,6 +79,7 @@
       assert(*n - nchars_avail == read_pos - *lineptr);
       if (nchars_avail < 1)
        {
+         *n -= nchars_avail; /* offset > *n on entry */
          if (*n > MIN_CHUNK)
            *n *= 2;
          else






reply via email to

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