[php-src] PR #20144: phar: Reduce code duplication wrt error handling in phar_parse_zipfile()
| From: | nielsdos | Date: | Sun, 12 Oct 2025 10:19:42 +0000 |
| Subject: | [php-src] PR #20144: phar: Reduce code duplication wrt error handling in phar_parse_zipfile() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-33601@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/20144
Author: nielsdos
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.