Bug #61650 [Opn->Csd]: ini parser crashes when using ${xxxx} ini variables ( without apache2 )
| From: | laruence@php.net | Date: | Fri, 06 Apr 2012 13:49:39 +0000 |
| Subject: | Bug #61650 [Opn->Csd]: ini parser crashes when using ${xxxx} ini variables ( without apache2 ) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-169291@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61650&edit=1
ID: 61650
Updated by: laruence@php.net
Reported by: e dot tirado at meetic-corp dot com
Summary: ini parser crashes when using ${xxxx} ini variables
( without apache2 )
-Status: Open
+Status: Closed
Type: Bug
Package: CGI/CLI related
Operating System: Redhat 5.8
PHP Version: 5.3.10
-Assigned To:
+Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
actually, you should use a existed env variable name to trigger this bug.
fixed
Previous Comments:
------------------------------------------------------------------------
[2012-04-06 13:43:10] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9bf8cd4b3437f6335e20843c9e3668b44761feba
Log: Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables (without apache2))
------------------------------------------------------------------------
[2012-04-06 13:37:55] nikic@php.net
I can't reproduce this:
nikic@pluto:~/dev$ cat php.ini
error_log = ${ERROR_LOG}
nikic@pluto:~/dev$ ERROR_LOG=foo php -c php.ini -i | grep error_log
error_log => foo => foo
------------------------------------------------------------------------
[2012-04-06 13:02:55] e dot tirado at meetic-corp dot com
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 this bug report at https://bugs.php.net/bug.php?id=61650&edit=1