Bug #71273 [Opn]: A wrong ext directory setup in php.ini leads to crash
| From: | laruence@php.net | Date: | Mon, 04 Jan 2016 11:45:50 +0000 |
| Subject: | Bug #71273 [Opn]: A wrong ext directory setup in php.ini leads to crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-198402@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71273&edit=1
ID: 71273
Updated by: laruence@php.net
Reported by: tlegall at easycom-aura dot com
Summary: A wrong ext directory setup in php.ini leads to
crash
Status: Open
Type: Bug
Package: Reproducible crash
Operating System: Windows
PHP Version: 7.0.1
-Assigned To:
+Assigned To: ab
Block user comment: N
Private report: N
New Comment:
can not reproduce on Linux, @welting could you please have a look into this?
Previous Comments:
------------------------------------------------------------------------
[2016-01-04 09:53:20] tlegall at easycom-aura dot com
Description:
------------
A wrongly configured extension_dir in the php.ini leads to a crash of apache, without any error
message.
I am using the latest 7.0.1 version from http://windows.php.net/, thread safe x86.
Test script:
---------------
Here is the line of the php.ini causing problems (missing : after the drive name)
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "c/wamp/bin/php/php7.0.1/ext"
Expected result:
----------------
Should log a warning indicating that the extensions cannot be found
Actual result:
--------------
Crash at the line 728 of main/main.c
The problem seems to come from the following code snippet, lines 724 - 729:
if (PG(html_errors)) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT,
NULL);
efree(buffer);
buffer = ZSTR_VAL(replace_buffer);
buffer_len = (int)ZSTR_LEN(replace_buffer);
}
replace_buffer is null, which leads to the crash of the ZSTR_LEN function.
Backtrace:
>
php7ts.dll!php_verror(const char * docref, const char * params, int type, const char * format, char
* args) Ligne 728 C
php7ts.dll!php_error_docref0(const char * docref, int type, const char * format, ...) Ligne 896 C
php7ts.dll!php_load_extension(char * filename, int type, int start_now) Ligne 137 C
php7ts.dll!php_load_php_extension_cb(void * arg) Ligne 344 C
php7ts.dll!php_ini_register_extensions() Ligne 739 C
php7apache2_4.dll!php_apache_server_startup(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t *
ptemp, server_rec * s) Ligne 465 C
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71273&edit=1