[Top][All Lists]

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

[Bug-gnulib] getline bugfix submitted via findutils

From: James Youngman
Subject: [Bug-gnulib] getline bugfix submitted via findutils
Date: Fri, 16 Apr 2004 20:15:56 +0100
User-agent: Mutt/1.3.28i

Gnulib's getline.c has undergone a lot of changes since
findutils-4.1.7 was released (4.1.20 is current now, but it is the
first release I have made as maintainer of findutils).

Hence the enclosed patch may no longer be relevant to the current
Gnulib code but I'm forwarding it to you guys in case it is useful.
I'll take a look at the code findutils is using these days because it
might still affect findutils-4.1.20 even if it doesn't affect Gnulib
any more.


--- Begin Message --- 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.


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;

Bug-findutils mailing list

--- End Message ---

reply via email to

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