mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Better fix bug #75540 Segfault with libzip 1.3.1
- only 1.3.1 is affected - fix use after free
This commit is contained in:
parent
8832c46607
commit
702ef27364
1 changed files with 3 additions and 2 deletions
|
@ -1513,9 +1513,10 @@ static ZIPARCHIVE_METHOD(close)
|
||||||
ze_obj = Z_ZIP_P(self);
|
ze_obj = Z_ZIP_P(self);
|
||||||
|
|
||||||
if ((err = zip_close(intern))) {
|
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));
|
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);
|
zip_discard(intern);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue