summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php5.c
diff options
context:
space:
mode:
authorBrian France <bfrance@php.net>2005-06-28 16:38:03 +0000
committerBrian France <bfrance@php.net>2005-06-28 16:38:03 +0000
commitf81d41c7621d6f204e26748d676e3d69456494b9 (patch)
tree0cdd972668e9f4854bfb47fa51f87df305b9f01d /sapi/apache/mod_php5.c
parent3059580aede25ac78900e8c85074052a9e3651e3 (diff)
downloadphp-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.
Diffstat (limited to 'sapi/apache/mod_php5.c')
-rw-r--r--sapi/apache/mod_php5.c4
1 files changed, 4 insertions, 0 deletions
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);
}
/* }}} */