[php-src] PR #14292: Fix GH-14290: Member access within null pointer in extension spl
| From: | nielsdos | Date: | Tue, 21 May 2024 17:43:27 +0000 |
| Subject: | [php-src] PR #14292: Fix GH-14290: Member access within null pointer in extension spl | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-26254@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/14292
Author: nielsdos
php_pcre_replace_impl() can fail and return NULL. We should take that error condition into account.
Because other failures return false, we return false here as well.
At first, I also thought there was a potential memory leak in the error check of replacement_str,
but found that the error condition can never trigger, so replace that with an assertion.