diff options
author | Brian France <bfrance@php.net> | 2005-06-28 16:38:03 +0000 |
---|---|---|
committer | Brian France <bfrance@php.net> | 2005-06-28 16:38:03 +0000 |
commit | f81d41c7621d6f204e26748d676e3d69456494b9 (patch) | |
tree | 0cdd972668e9f4854bfb47fa51f87df305b9f01d | |
parent | 3059580aede25ac78900e8c85074052a9e3651e3 (diff) | |
download | php-git-f81d41c7621d6f204e26748d676e3d69456494b9.tar.gz |
MFH:
Added a SG(server_context) NULL check to php_apache_getenv.
This can get called when "<key> = ${<key>}:/foo" is used in a .ini file, but <key> has not be set yet.
You will end up with a value of ":/foo", but at least it will not crash.
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | sapi/apache/mod_php5.c | 4 |
2 files changed, 5 insertions, 0 deletions
@@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2005, PHP 5.0.5 - Upgraded PCRE library to version 5.0. (Andrei) - Removed php_check_syntax() function which never worked properly. (Ilia) +- Added a SG(server_context) NULL check to php_apache_getenv. (Brian) - Added new function mysqli_set_charset(). (Georg) - Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana) - Added support for .cc files in extensions. (Brian) diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 74707ce7f2..d7672fd338 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -352,6 +352,10 @@ static struct stat *php_apache_get_stat(TSRMLS_D) */ static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) { + if (SG(server_context) == NULL) { + return NULL; + } + return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name); } /* }}} */ |