rpms/grep/devel grep-mem-exhausted.patch, NONE, 1.1 grep.spec, 1.62, 1.63

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Nov 22 14:55:14 UTC 2006


Author: twaugh

Update of /cvs/dist/rpms/grep/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv30181

Modified Files:
	grep.spec 
Added Files:
	grep-mem-exhausted.patch 
Log Message:
* Wed Nov 22 2006 Tim Waugh <twaugh at redhat.com> 2.5.1-55
- Fix 'memory exhausted' errors by limiting in-memory buffer (bug #198165).
- Resolves: rhbz#198165


grep-mem-exhausted.patch:
 grep.c |    6 ++++++
 1 files changed, 6 insertions(+)

--- NEW FILE grep-mem-exhausted.patch ---
--- grep-2.5.1a/src/grep.c.mem-exhausted	2006-11-22 14:49:35.000000000 +0000
+++ grep-2.5.1a/src/grep.c	2006-11-22 14:53:12.000000000 +0000
@@ -299,6 +299,12 @@
   int cc = 1;
   char *readbuf;
   size_t readsize;
+  const size_t max_save = 200 * 1024 * 1024;
+
+  /* Limit the amount of saved data to 200Mb so we don't fail on
+   * large files. */
+  if (save > max_save)
+    save = max_save;
 
   /* Offset from start of buffer to start of old stuff
      that we want to save.  */


Index: grep.spec
===================================================================
RCS file: /cvs/dist/rpms/grep/devel/grep.spec,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- grep.spec	12 Jul 2006 06:14:17 -0000	1.62
+++ grep.spec	22 Nov 2006 14:55:12 -0000	1.63
@@ -1,7 +1,7 @@
 Summary: The GNU versions of grep pattern matching utilities.
 Name: grep
 Version: 2.5.1
-Release: 54.1
+Release: 55%{?dist}
 License: GPL
 Group: Applications/Text
 Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}a.tar.bz2
@@ -18,6 +18,7 @@
 Patch12: grep-2.5.1-tests.patch
 Patch13: grep-2.5.1-w.patch
 Patch14: grep-P.patch
+Patch15: grep-mem-exhausted.patch
 URL: http://www.gnu.org/software/grep/
 Prereq: /sbin/install-info
 Buildroot: %{_tmppath}/%{name}-%{version}-root
@@ -47,6 +48,7 @@
 %patch12 -p1 -b .tests
 %patch13 -p1 -b .w
 %patch14 -p1 -b .P
+%patch15 -p1 -b .mem-exhausted
 chmod a+x tests/fmbtest.sh
 
 %build
@@ -96,6 +98,9 @@
 %{_mandir}/*/*
 
 %changelog
+* Wed Nov 22 2006 Tim Waugh <twaugh at redhat.com> 2.5.1-55
+- Fix 'memory exhausted' errors by limiting in-memory buffer (bug #198165).
+
 * Wed Jul 12 2006 Jesse Keating <jkeating at redhat.com> - 2.5.1-54.1
 - rebuild
 




More information about the fedora-cvs-commits mailing list