Accepting request 546292 from Archiving

OBS-URL: https://build.opensuse.org/request/show/546292
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zip?expand=0&rev=23
This commit is contained in:
Dominique Leuenberger 2017-12-03 09:08:38 +00:00 committed by Git OBS Bridge
commit f64c21e0a8
3 changed files with 75 additions and 1 deletions

View File

@ -0,0 +1,65 @@
--- zipfile.c
+++ zipfile.c
@@ -2166,7 +2166,7 @@ int readlocal(localz, z)
#ifndef UTIL
ulg start_disk = 0;
uzoff_t start_offset = 0;
- char *split_path;
+ char *split_path = NULL;
start_disk = z->dsk;
start_offset = z->off;
@@ -2197,6 +2197,7 @@ int readlocal(localz, z)
split_path = get_in_split_path(in_path, start_disk);
}
}
+ if (split_path) free(split_path);
#endif
/* For utilities assume archive is on one disk for now */
@@ -6014,7 +6015,7 @@ int zipcopy(z)
ulg e = 0; /* extended local header size */
ulg start_disk = 0;
uzoff_t start_offset = 0;
- char *split_path;
+ char *split_path = NULL;
char buf[LOCHEAD + 1];
struct zlist far *localz;
int r;
@@ -6063,6 +6064,7 @@ int zipcopy(z)
split_path = get_in_split_path(in_path, start_disk);
}
}
+ if (split_path) free(split_path);
if (zfseeko(in_file, start_offset, SEEK_SET) != 0) {
fclose(in_file);
--- zip.c
+++ zip.c
@@ -3450,6 +3450,7 @@ char **argv; /* command line
}
}
*/
+ free(value); /* Added by Polo from forum */
if (kk == 3) {
first_listarg = argnum;
kk = 4;
--- fileio.c
+++ fileio.c
@@ -696,6 +696,7 @@ int newnamew(namew, isdir, casesensitive
return ZE_MEM;
}
strcpy(z->name, name);
+ if (z->oname) free(z->oname);
z->oname = oname;
oname = NULL;
z->dosflag = dosflag;
@@ -959,6 +960,7 @@ int newname(name, isdir, casesensitive)
return ZE_MEM;
}
strcpy(z->name, name);
+ if (z->oname) free(z->oname);
z->oname = oname;
z->dosflag = dosflag;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Nov 28 16:29:02 UTC 2017 - kstreitova@suse.com
- add zip-3.0-fix-memory_leaks.patch to fix memory leaks in zip.c,
zipfile.c and fileio.c files [bsc#1068346]
-------------------------------------------------------------------
Thu Jun 18 10:00:00 UTC 2015 - hsk@imb-jena.de

View File

@ -1,7 +1,7 @@
#
# spec file for package zip
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -32,6 +32,8 @@ Patch5: zip-3.0-optflags.patch
Patch6: zip-3.0-tempfile.patch
Patch7: zip-notimestamp.patch
Patch8: zip-3.0-nomutilation.patch
# PATCH-FIX-UPSTREAM bsc#1068346 kstreitova@suse.com -- fix memory leaks
Patch9: zip-3.0-fix-memory_leaks.patch
Provides: crzip = %{version}
Obsoletes: crzip < %{version}
BuildRequires: libbz2-devel
@ -50,6 +52,7 @@ PKZIP(tm) 2.04g (Phil Katz ZIP) for MS-DOS systems.
%patch6
%patch7
%patch8
%patch9
%build
make %{?_smp_mflags} -f unix/Makefile prefix=/usr CC="gcc %{optflags} -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc