From de47d4792fdefbcea023877c931cbdc15dd38963 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 20 Nov 2017 08:49:46 +0100 Subject: [PATCH 1/3] fix bug #75540 Segfault with libzip 1.3.1 --- ext/zip/php_zip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 45bf8afb672..f439340ed81 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1514,7 +1514,10 @@ static ZIPARCHIVE_METHOD(close) if ((err = zip_close(intern))) { php_error_docref(NULL, E_WARNING, "%s", zip_strerror(intern)); +#if LIBZIP_VERSION_MAJOR < 1 || (LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR < 3) || (LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO < 1) + /* Fix memory leak in libzip < 1.3.1 */ zip_discard(intern); +#endif } efree(ze_obj->filename); From 8832c46607cd9e9a143d954a10dfec2b61295bbb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 20 Nov 2017 08:50:33 +0100 Subject: [PATCH 2/3] NEWS --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 57d0fdb9736..5eedd83363b 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,9 @@ PHP NEWS . Fixed bug #75535 (Inappropriately parsing HTTP response leads to PHP segment fault). (Nikita) +- Zip: + . Fixed bug #75540 (Segfault with libzip 1.3.1). (Remi) + 23 Nov 2017 PHP 7.0.26 - Core: From 50a867eb07c1fa82e113837422d55c2341b53719 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 20 Nov 2017 08:51:13 +0100 Subject: [PATCH 3/3] NEWS --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 806cf7df837..2c00d49f3a1 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,9 @@ PHP NEWS . Fixed bug #75535 (Inappropriately parsing HTTP response leads to PHP segment fault). (Nikita) +- Zip: + . Fixed bug #75540 (Segfault with libzip 1.3.1). (Remi) + 23 Nov 2017, PHP 7.1.12 - Core: