diff --git a/ncompress-4.2.4-uncheckedmalloc.patch b/ncompress-4.2.4-uncheckedmalloc.patch new file mode 100644 index 0000000..729ef07 --- /dev/null +++ b/ncompress-4.2.4-uncheckedmalloc.patch @@ -0,0 +1,34 @@ +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 + #include ++#include + #include + #include + #include +@@ -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; + } diff --git a/ncompress.spec b/ncompress.spec index 55023cc..9499b0c 100644 --- a/ncompress.spec +++ b/ncompress.spec @@ -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 @@ Patch3: ncompress-2GB.patch 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 @@ which are compatible with the original UNIX compress utility. %patch4 -p1 -b .zerobyteforce %patch5 -p1 -b .bssUnderflow %patch6 -p1 -b .endians +%patch7 -p1 -b .malloccheck %build @@ -71,6 +73,11 @@ rm -rf $RPM_BUILD_ROOT %doc LZW.INFO README %changelog +* Mon Dec 01 2008 Ondrej Vasik - 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 - 4.2.4-50 - Autorebuild for GCC 4.3