Skip to content

Commit 3884438

Browse files
committed
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 phpGH-20293
1 parent 27bc7c0 commit 3884438

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ PHP NEWS
1414
. Fixed bug GH-19798: XP_SOCKET XP_SSL (Socket stream modules): Incorrect
1515
condition for Win32/Win64. (Jakub Zelenka)
1616

17+
- Zip:
18+
. Fixed missing zend_release_fcall_info_cache on the following methods
19+
ZipArchive::registerProgressCallback() and ZipArchive::registerCancelCallback()
20+
on failure. (David Carlier)
21+
1722

1823
23 Oct 2025, PHP 8.5.0RC3
1924

ext/zip/php_zip.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,6 +3026,7 @@ PHP_METHOD(ZipArchive, registerProgressCallback)
30263026

30273027
/* register */
30283028
if (zip_register_progress_callback_with_state(intern, rate, php_zip_progress_callback, php_zip_progress_callback_free, obj)) {
3029+
zend_release_fcall_info_cache(&fcc);
30293030
RETURN_FALSE;
30303031
}
30313032
zend_fcc_dup(&obj->progress_callback, &fcc);
@@ -3081,6 +3082,7 @@ PHP_METHOD(ZipArchive, registerCancelCallback)
30813082

30823083
/* register */
30833084
if (zip_register_cancel_callback_with_state(intern, php_zip_cancel_callback, php_zip_cancel_callback_free, obj)) {
3085+
zend_release_fcall_info_cache(&fcc);
30843086
RETURN_FALSE;
30853087
}
30863088
zend_fcc_dup(&obj->cancel_callback, &fcc);

0 commit comments

Comments
 (0)