Edit report at https://bugs.php.net/bug.php?id=61650&edit=1

 ID:                 61650
 Comment by:         ni...@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
 Type:               Bug
 Package:            CGI/CLI related
 Operating System:   Redhat 5.8
 PHP Version:        5.3.10
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[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

Reply via email to