[php-src] PR #13056: Fix #77432: Segmentation fault on including phar file
| From: | nielsdos | Date: | Sat, 30 Dec 2023 23:04:49 +0000 |
| Subject: | [php-src] PR #13056: Fix #77432: Segmentation fault on including phar file | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-24634@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13056
Author: nielsdos
phar_get_pharfp() can return NULL. In this case this is because the stream gets closed by the
include code in the engine. However, the phar entry is still cached, so when the next include
happens the engine tries to read from a closed (and nullified) stream.
Use the same fix as in phar_open_entry_fp(): take into account that the phar_get_pharfp() can return
NULL and in that case reopen the phar archive.