Skip to content

Conversation

nielsdos
Copy link
Member

The PHAR_ZIP_FAIL and PHAR_ZIP_FAIL_FREE macros are almost the same. The reason the latter exists is because of a single error path where the error message is on the heap and needs to be freed. Instead, use a stack allocated variable for the error message so we can get rid of the duplicate macro code. This stack variable is big enough as the messages written by phar_verify_signature() are short.

The PHAR_ZIP_FAIL and PHAR_ZIP_FAIL_FREE macros are almost the same.
The reason the latter exists is because of a single error path where the
error message is on the heap and needs to be freed. Instead, use a stack
allocated variable for the error message so we can get rid of the
duplicate macro code. This stack variable is big enough as the messages
written by phar_verify_signature() are short.
@nielsdos
Copy link
Member Author

Perhaps this should actually target 8.3 as this will make further fixes to the error handling code less error-prone...

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

I agree with backporting this

@nielsdos nielsdos closed this in f9aeb9e Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants