[php-src] PR #24141: Fix GH-24139: NULL dereference in php_ini.c when expand_filepath() fails
| From: | lazerg | Date: | Mon, 05 Oct 2026 17:43:27 +0000 |
| Subject: | [php-src] PR #24141: Fix GH-24139: NULL dereference in php_ini.c when expand_filepath() fails | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39174@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24141
Author: lazerg
When the ini file passed with
-c (or PHPRC) is a relative path, it can be
opened fine while expand_filepath() still returns NULL, because the cwd plus the
relative path goes over MAXPATHLEN. filename then ends up NULL and the
strlen(filename) for cfg_file_path segfaults. Falling back to the path as
given avoids the crash. The test reproduces it with a long run of ./ in front of the
ini name.
Fixes #24139