Bug #71273 [NEW]: A wrong ext directory setup in php.ini leads to crash

From: Date: Mon, 04 Jan 2016 09:53:25 +0000
Subject: Bug #71273 [NEW]: A wrong ext directory setup in php.ini leads to crash
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198398@lists.php.net to get a copy of this message
From: tlegall at easycom-aura dot com Operating system: Windows PHP version: 7.0.1 Package: Reproducible crash Bug Type: Bug Bug description:A wrong ext directory setup in php.ini leads to crash 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 bug report at https://bugs.php.net/bug.php?id=71273&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71273&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71273&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71273&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71273&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71273&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71273&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71273&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71273&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71273&r=support Expected behavior: https://bugs.php.net/fix.php?id=71273&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71273&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71273&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71273&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71273&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71273&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71273&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71273&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71273&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71273&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71273&r=mysqlcfg

« previous php.bugs (#198398) next »