Browse Source

Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Better fix bug #75540 Segfault with libzip 1.3.1 - only 1.3.1 is affected - fix use after free
pull/2957/head
Remi Collet 9 years ago
parent
commit
307e15592b
  1. 5
      ext/zip/php_zip.c

5
ext/zip/php_zip.c

@ -1536,9 +1536,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
}

Loading…
Cancel
Save