Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ext/phar/phar_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,12 +689,15 @@ PHP_METHOD(Phar, webPhar)
rewrite_fci.retval = &retval;

if (FAILURE == zend_call_function(&rewrite_fci, &rewrite_fcc)) {
zval_ptr_dtor_str(&params);
if (!EG(exception)) {
zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: failed to call rewrite callback");
}
goto cleanup_fail;
}
Comment on lines 691 to 697
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this even fail?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably not


zval_ptr_dtor_str(&params);

if (Z_TYPE_P(rewrite_fci.retval) == IS_UNDEF || Z_TYPE(retval) == IS_UNDEF) {
zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");
goto cleanup_fail;
Expand All @@ -720,7 +723,6 @@ PHP_METHOD(Phar, webPhar)
zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");

cleanup_fail:
zval_ptr_dtor(&params);
if (free_pathinfo) {
efree(path_info);
}
Expand Down
Loading