mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
fix use after free
This commit is contained in:
parent
ed998f8a0d
commit
ef42a7afa5
1 changed files with 15 additions and 15 deletions
|
@ -1503,11 +1503,17 @@ static ZIPARCHIVE_METHOD(close)
|
|||
ze_obj = Z_ZIP_P(self);
|
||||
|
||||
err = zip_close(intern);
|
||||
|
||||
/* Save error for property reader */
|
||||
#if LIBZIP_VERSION_MAJOR < 1
|
||||
zip_error_get(obj->za, &ze_obj->err_zip, &ze_obj->err_sys);
|
||||
if (err) {
|
||||
#if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1
|
||||
php_error_docref(NULL, E_WARNING, "zip_close have failed");
|
||||
ze_obj->err_zip = 0;
|
||||
ze_obj->err_sys = 0;
|
||||
#else
|
||||
php_error_docref(NULL, E_WARNING, "%s", zip_strerror(intern));
|
||||
/* Save error for property reader */
|
||||
#if LIBZIP_VERSION_MAJOR < 1
|
||||
zip_error_get(intern, &ze_obj->err_zip, &ze_obj->err_sys);
|
||||
#else
|
||||
{
|
||||
zip_error_t *ziperr;
|
||||
|
||||
|
@ -1516,13 +1522,7 @@ static ZIPARCHIVE_METHOD(close)
|
|||
ze_obj->err_sys = zip_error_code_system(ziperr);
|
||||
zip_error_fini(ziperr);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (err) {
|
||||
#if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1
|
||||
php_error_docref(NULL, E_WARNING, "zip_close have failed");
|
||||
#else
|
||||
php_error_docref(NULL, E_WARNING, "%s", zip_strerror(intern));
|
||||
#endif
|
||||
zip_discard(intern);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue