--- 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.
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
_______________________________________________
Bug-findutils mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/bug-findutils
--- End Message ---