rpms/ncompress/devel ncompress-4.2.4-uncheckedmalloc.patch, NONE, 1.1 ncompress.spec, 1.26, 1.27

Ondrej Vasik ovasik at fedoraproject.org
Mon Dec 1 13:45:14 UTC 2008


Author: ovasik

Update of /cvs/extras/rpms/ncompress/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23970

Modified Files:
	ncompress.spec 
Added Files:
	ncompress-4.2.4-uncheckedmalloc.patch 
Log Message:
newURL, fixed small memoryleak, check for malloc success (#473488)

ncompress-4.2.4-uncheckedmalloc.patch:

--- NEW FILE ncompress-4.2.4-uncheckedmalloc.patch ---
diff -urNp ncompress-4.2.4-orig/compress42.c ncompress-4.2.4/compress42.c
--- ncompress-4.2.4-orig/compress42.c	2008-12-01 13:50:17.000000000 +0100
+++ ncompress-4.2.4/compress42.c	2008-12-01 13:53:03.000000000 +0100
@@ -132,6 +132,7 @@
  */
 #include	<unistd.h>
 #include	<stdio.h>
+#include  <stdlib.h>
 #include	<fcntl.h>
 #include	<ctype.h>
 #include	<signal.h>
@@ -696,7 +697,13 @@ main(argc, argv)
             }
         }
 
-        filelist = fileptr = (char **)malloc(argc*sizeof(char *));
+        filelist = (char **)malloc(argc*sizeof(char *));
+        if (filelist == NULL)
+          {
+             fprintf(stderr, "Cannot allocate memory for file list.\n");
+             exit (1);
+          }
+        fileptr = filelist;
     	*filelist = NULL;
 
     	if((progname = rindex(argv[0], '/')) != 0)
@@ -836,6 +843,7 @@ nextarg:	continue;
 				decompress(0, 1);
 		}
         
+    free(filelist);
 		exit((exit_code== -1) ? 1:exit_code);
                 return 0;
 	}


Index: ncompress.spec
===================================================================
RCS file: /cvs/extras/rpms/ncompress/devel/ncompress.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ncompress.spec	19 Feb 2008 20:59:21 -0000	1.26
+++ ncompress.spec	1 Dec 2008 13:44:43 -0000	1.27
@@ -1,10 +1,10 @@
 Summary: Fast compression and decompression utilities
 Name: ncompress
 Version: 4.2.4
-Release: 50%{?dist}
+Release: 51%{?dist}
 License: Public Domain
 Group: Applications/File
-URL:    ftp://sunsite.unc.edu/pub/Linux/utils/compress/
+URL:    http://ncompress.sourceforge.net/
 Source: ftp://metalab.unc.edu/pub/Linux/utils/compress/%{name}-%{version}.tar.Z
 Patch0: ncompress-4.2.4-make.patch
 Patch1: ncompress-4.2.4-lfs2.patch
@@ -13,6 +13,7 @@
 Patch4: ncompress-4.2.4-zerobyteforce.patch
 Patch5: ncompress-4.2.4-bssUnderflow.patch
 Patch6: ncompress-4.2.4-endians.patch
+Patch7: ncompress-4.2.4-uncheckedmalloc.patch
 BuildRequires: gcc glibc-devel fileutils
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -35,6 +36,7 @@
 %patch4 -p1 -b .zerobyteforce
 %patch5 -p1 -b .bssUnderflow
 %patch6 -p1 -b .endians
+%patch7 -p1 -b .malloccheck
 
 %build
 
@@ -71,6 +73,11 @@
 %doc LZW.INFO README
 
 %changelog
+* Mon Dec 01 2008 Ondrej Vasik <ovasik at redhat.com> - 4.2.4-51
+- check malloc success (#473488)
+- fix few compiler warnings, free malloc memory before exit
+- new URL
+
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 4.2.4-50
 - Autorebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list