From 7edff8842c1a91d721a719aa1d9b642398dd763e00551c83e6386d55611f43d2 Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Mon, 30 May 2011 07:04:50 +0000 Subject: [PATCH] Accepting request 71640 from Base:System - fix bnc#679345: zlib segfaults when passing NULL to gzopen * return NULL checks back to gz_open OBS-URL: https://build.opensuse.org/request/show/71640 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zlib?expand=0&rev=31 --- zlib-1.2.5-gzopen-null-check.patch | 14 ++++++++++++++ zlib.changes | 6 ++++++ zlib.spec | 3 +++ 3 files changed, 23 insertions(+) create mode 100644 zlib-1.2.5-gzopen-null-check.patch diff --git a/zlib-1.2.5-gzopen-null-check.patch b/zlib-1.2.5-gzopen-null-check.patch new file mode 100644 index 0000000..c05c134 --- /dev/null +++ b/zlib-1.2.5-gzopen-null-check.patch @@ -0,0 +1,14 @@ +Index: zlib-1.2.5_git201105121450/gzlib.c +=================================================================== +--- zlib-1.2.5_git201105121450.orig/gzlib.c 2011-05-12 16:50:18.000000000 +0200 ++++ zlib-1.2.5_git201105121450/gzlib.c 2011-05-27 10:45:36.467678080 +0200 +@@ -91,6 +91,9 @@ + { + gz_statep state; + ++ if (!path || !mode) ++ return NULL; ++ + /* allocate gzFile structure to return */ + state = malloc(sizeof(gz_state)); + if (state == NULL) diff --git a/zlib.changes b/zlib.changes index bdfd407..2887145 100644 --- a/zlib.changes +++ b/zlib.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 27 09:13:31 UTC 2011 - mvyskocil@suse.cz + +- fix bnc#679345: zlib segfaults when passing NULL to gzopen + * return NULL checks back to gz_open + ------------------------------------------------------------------- Thu May 12 20:02:26 UTC 2011 - crrodriguez@opensuse.org diff --git a/zlib.spec b/zlib.spec index d11b6df..e3b45c8 100644 --- a/zlib.spec +++ b/zlib.spec @@ -41,6 +41,8 @@ Patch0: zlib-1.2.2-format.patch Patch1: zlib-lfs.patch # PATCH-FIX-JENGELH-PARALLEL-MAKE zlib-parallel.patch meissner@novell.com -- shared library links with libz.a Patch2: zlib-parallel.patch +# PATCH-FIX-UPSTREAM: bnc#679345 --return NULL checks from 1.2.3 removed by upstream +Patch3: zlib-1.2.5-gzopen-null-check.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: pkgconfig @@ -85,6 +87,7 @@ libraries. %patch0 %patch1 %patch2 -p1 +%patch3 -p1 %build # Marcus: breaks example64 in 32bit builds.