- Prevent 'grep -P' from segfaulting (bug #171379).

This commit is contained in:
Tim Waugh 2006-02-03 14:12:33 +00:00
parent c7de272d37
commit 61501477eb
2 changed files with 20 additions and 1 deletions

14
grep-P.patch Normal file
View File

@ -0,0 +1,14 @@
--- grep-2.5.1a/src/search.c.P 2006-02-03 14:08:00.000000000 +0000
+++ grep-2.5.1a/src/search.c 2006-02-03 14:11:20.000000000 +0000
@@ -1234,8 +1234,9 @@
char eol = eolbyte;
if (!exact)
{
- end = memchr (end, eol, buflim - end);
- end++;
+ while (end < buflim)
+ if (*end++ == eol)
+ break;
while (buf < beg && beg[-1] != eol)
--beg;
}

View File

@ -1,7 +1,7 @@
Summary: The GNU versions of grep pattern matching utilities.
Name: grep
Version: 2.5.1
Release: 51.1
Release: 52
License: GPL
Group: Applications/Text
Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}a.tar.bz2
@ -16,6 +16,7 @@ Patch10: grep-2.5.1-egf-speedup.patch
Patch11: grep-2.5.1-dfa-optional.patch
Patch12: grep-2.5.1-tests.patch
Patch13: grep-2.5.1-w.patch
Patch14: grep-P.patch
URL: http://www.gnu.org/software/grep/
Prereq: /sbin/install-info
Buildroot: %{_tmppath}/%{name}-%{version}-root
@ -43,6 +44,7 @@ utility for searching through text.
%patch11 -p1 -b .dfa-optional
%patch12 -p1 -b .tests
%patch13 -p1 -b .w
%patch14 -p1 -b .P
chmod a+x tests/fmbtest.sh
%build
@ -92,6 +94,9 @@ fi
%{_mandir}/*/*
%changelog
* Fri Feb 3 2006 Tim Waugh <twaugh@redhat.com> 2.5.1-52
- Prevent 'grep -P' from segfaulting (bug #171379).
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt