php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13340 get_defined_constants crashed on default value of constant DEFAULT_INCLUDE_PATH
Submitted: 2001-09-17 05:54 UTC Modified: 2001-10-15 05:03 UTC
From: dacota at iis dot nsk dot su Assigned: ssb (profile)
Status: Closed Package: Reproducible crash
PHP Version: 4.0CVS-2001-10-14 OS: Win32
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dacota at iis dot nsk dot su
New email:
PHP Version: OS:

 

 [2001-09-17 05:54 UTC] dacota at iis dot nsk dot 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 ".;"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-17 07:27 UTC] dacota at iis dot nsk dot 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-18 08:39 UTC] dacota at iis dot nsk dot 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-10-14 17:17 UTC] mfischer@php.net
This still crashes on Win32 when building from CVS.

Fix is in the report, someone with karma do the right thing please ? :)

- Markus
 [2001-10-15 01:47 UTC] ssb@php.net
Changed to ":" in CVS, please test and let me know if it stopped crashing.

 [2001-10-15 04:27 UTC] mfischer@php.net
Still crashes. I did another test run and now its the PHP_EXTENSION_DIR like dacota mentioned.

- Markus
 [2001-10-15 05:03 UTC] mfischer@php.net
Fixed in CVS.

- Markus
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 15:01:31 2025 UTC