diff options
author | Remi Collet <remi@php.net> | 2017-11-20 09:42:20 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2017-11-20 09:42:20 +0100 |
commit | 702ef2736479af85ce17aec83c6cfc1fecccf326 (patch) | |
tree | cc4d7ab4b0fd1307b5223e99cb7a876d8b141893 | |
parent | 8832c46607cd9e9a143d954a10dfec2b61295bbb (diff) | |
download | php-git-702ef2736479af85ce17aec83c6cfc1fecccf326.tar.gz |
Better fix bug #75540 Segfault with libzip 1.3.1
- only 1.3.1 is affected
- fix use after free
-rw-r--r-- | ext/zip/php_zip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index f439340ed8..aee355b04d 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 } |