Skip to content
Merged
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
6 changes: 1 addition & 5 deletions ext/phar/phar.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,9 @@ zend_result phar_metadata_tracker_unserialize_or_copy(phar_metadata_tracker *tra
const bool has_unserialize_options = unserialize_options != NULL && zend_hash_num_elements(unserialize_options) > 0;
/* It should be impossible to create a zval in a persistent phar/entry. */
ZEND_ASSERT(!persistent || Z_ISUNDEF(tracker->val));
ZEND_ASSERT(!EG(exception));
Copy link
Member

Choose a reason for hiding this comment

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

nit: I would not mind a comment.


if (Z_ISUNDEF(tracker->val) || has_unserialize_options) {
if (EG(exception)) {
/* Because other parts of the phar code haven't been updated to check for exceptions after doing something that may throw,
* check for exceptions before potentially serializing/unserializing instead. */
return FAILURE;
}
/* Persistent phars should always be unserialized. */
const char *start;
/* Assert it should not be possible to create raw data in a persistent phar (i.e. from cache_list) */
Expand Down