Bug #13340 Updated: get_defined_constants crashed on default value of constant DEFAULT_INCLUDE_PATH
| From: | mfischer@php.net | Date: | Sun, 14 Oct 2001 21:17:36 +0000 |
| Subject: | Bug #13340 Updated: get_defined_constants crashed on default value of constant DEFAULT_INCLUDE_PATH | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67932@lists.php.net to get a copy of this message | ||
ID: 13340
Updated by: mfischer
Reported By: dacota@iis.nsk.su
Old Status: Open
Status: Critical
Bug Type: Reproducible crash
Operating System: Win32
Old PHP Version: 4.0CVS-2001-09-17
PHP Version: 4.0CVS-2001-10-14
New Comment:
This still crashes on Win32 when building from CVS.
Fix is in the report, someone with karma do the right thing please ? :)
- Markus
Previous Comments:
------------------------------------------------------------------------
[2001-09-18 08:39:18] dacota@iis.nsk.su
I thought that maybe better to add check to
zend_register_stringl_constant
for NULL?
replacing
c.value.value.str.val = strval;
by
c.value.value.str.val = strval ? strval : empty_string;
?
------------------------------------------------------------------------
[2001-09-17 07:27:44] dacota@iis.nsk.su
This also apply to PHP_EXTENSION_DIR, which is defined as NULL in config.win32.h
PHP_EXTENSION_DIR also should be defined as empty_string or ""
------------------------------------------------------------------------
[2001-09-17 05:54:13] dacota@iis.nsk.su
PHP_INCLUDE_PATH defined as NULL in
in config.win32.h
(#define PHP_INCLUDE_PATH NULL)
and when declaring constant in main.c as
REGISTER_MAIN_STRINGL_CONSTANT("DEFAULT_INCLUDE_PATH", PHP_INCLUDE_PATH,
sizeof(PHP_INCLUDE_PATH)-1, CONST_PERSISTENT | CONST_CS);
and it drive to broken zval where str.val = 0
if no value is specified in php.ini
PHP_INCLUDE_PATH should be defined as empty_string or ".;"
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13340&edit=1