summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2017-11-20 09:42:47 +0100
committerRemi Collet <remi@php.net>2017-11-20 09:42:47 +0100
commitd773a92f3c49c3f17079153d7bd9b44462266996 (patch)
treef800b2e7d114cf297166b952860a68096c1ccba2 /ext
parent50a867eb07c1fa82e113837422d55c2341b53719 (diff)
parent702ef2736479af85ce17aec83c6cfc1fecccf326 (diff)
downloadphp-git-d773a92f3c49c3f17079153d7bd9b44462266996.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Better fix bug #75540 Segfault with libzip 1.3.1 - only 1.3.1 is affected - fix use after free
Diffstat (limited to 'ext')
-rw-r--r--ext/zip/php_zip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 0cebe14d99..0d1ab7e022 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1513,9 +1513,10 @@ static ZIPARCHIVE_METHOD(close)
ze_obj = Z_ZIP_P(self);
if ((err = zip_close(intern))) {
+#if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1
+ php_error_docref(NULL, E_WARNING, "%s", "zip_close have failed");
+#else
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
}