summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php5.c
diff options
context:
space:
mode:
authorBrian France <bfrance@php.net>2005-06-28 16:34:18 +0000
committerBrian France <bfrance@php.net>2005-06-28 16:34:18 +0000
commit3137e1e4228a73b8dd19c6126ea856612734c010 (patch)
treed5d0eb6c3f0faf56493105a152090a6f8be7a1dc /sapi/apache/mod_php5.c
parent8c0dc5e88757f20799395c37f9c7f3159a8e428b (diff)
downloadphp-git-3137e1e4228a73b8dd19c6126ea856612734c010.tar.gz
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 now.
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 41484308c9..0d4a3f4662 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);
}
/* }}} */