From 3884438fe33b0a45fe0839d4a8b352b28b00b800 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 25 Oct 2025 21:00:10 +0100 Subject: [PATCH] ext/zip: ZipArchive callback missing zend_release_fcall_info_cache during FCC conversion (79b9fe3) in the rare cases where the lib fails to allocate the memory for these callbacks, we return false directly. close GH-20293 --- NEWS | 5 +++++ ext/zip/php_zip.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 23933494c82..d8d7cda775b 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,11 @@ PHP NEWS . Fixed bug GH-19798: XP_SOCKET XP_SSL (Socket stream modules): Incorrect condition for Win32/Win64. (Jakub Zelenka) +- Zip: + . Fixed missing zend_release_fcall_info_cache on the following methods + ZipArchive::registerProgressCallback() and ZipArchive::registerCancelCallback() + on failure. (David Carlier) + 23 Oct 2025, PHP 8.5.0RC3 diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 1a49bc1d10b..34ac611c99b 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -3026,6 +3026,7 @@ PHP_METHOD(ZipArchive, registerProgressCallback) /* register */ if (zip_register_progress_callback_with_state(intern, rate, php_zip_progress_callback, php_zip_progress_callback_free, obj)) { + zend_release_fcall_info_cache(&fcc); RETURN_FALSE; } zend_fcc_dup(&obj->progress_callback, &fcc); @@ -3081,6 +3082,7 @@ PHP_METHOD(ZipArchive, registerCancelCallback) /* register */ if (zip_register_cancel_callback_with_state(intern, php_zip_cancel_callback, php_zip_cancel_callback_free, obj)) { + zend_release_fcall_info_cache(&fcc); RETURN_FALSE; } zend_fcc_dup(&obj->cancel_callback, &fcc);