From: Operating system: Redhat 5.8 PHP version: 5.3.10 Package: CGI/CLI related Bug Type: Bug Bug description:ini parser crashes when using ${xxxx} ini variables ( without apache2 )
Description: ------------ Hello, PHP-CGI keeps crashing when loading configuration file with variable in <php.ini> file. Variable are declared as ENV ones. It doesn't crash if the variable is undefined. I Think this bug is related to this one already corrected but only for apache2 thing : https://bugs.php.net/bug.php?id=49677 sapi_getenv (NO apache2) versus php_apache_sapi_getenv (apache2) Test script: --------------- Into php.ini file : error_log = ${titi} Expected result: ---------------- PHP should not crash. Actual result: -------------- (gdb) backtrace #0 0x0000000000000000 in ?? () #1 0x000000000063ed5a in sapi_getenv (name=0x14fcff10 "toto", name_len=<value optimized out>) at /usr/src/debug/php-5.3.10/main/SAPI.c:947 #2 0x0000000000664224 in zend_ini_get_var () at /usr/src/debug/php-5.3.10/Zend/zend_ini_parser.c:225 #3 ini_parse () at /usr/src/debug/php-5.3.10/Zend/zend_ini_parser.c:1840 #4 0x000000000066431e in zend_parse_ini_file (fh=0x7fff6b56ab40, unbuffered_errors=1 '\001', scanner_mode=<value optimized out>, ini_parser_cb=<value optimized out>, arg=<value optimized out>) at /usr/src/debug/php-5.3.10/Zend/zend_ini_parser.c:283 #5 0x000000000063dbe3 in php_init_config () at /usr/src/debug/php-5.3.10/main/php_ini.c:620 #6 0x00000000006371ca in php_module_startup (sf=<value optimized out>, additional_modules=0xc2ef80, num_additional_modules=1) at /usr/src/debug/php-5.3.10/main/main.c:2012 #7 0x000000000070a633 in php_cgi_startup (sapi_module=0x4) at /usr/src/debug/php-5.3.10/sapi/cgi/cgi_main.c:883 #8 0x000000000070ada8 in main (argc=3, argv=0x7fff6b56d3d8) at /usr/src/debug/php-5.3.10/sapi/cgi/cgi_main.c:1623 -- Edit bug report at https://bugs.php.net/bug.php?id=61650&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61650&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61650&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61650&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61650&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61650&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61650&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61650&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61650&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61650&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61650&r=support Expected behavior: https://bugs.php.net/fix.php?id=61650&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61650&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61650&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61650&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61650&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61650&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61650&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61650&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61650&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61650&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61650&r=mysqlcfg