summaryrefslogtreecommitdiff
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
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.
-rw-r--r--NEWS1
-rw-r--r--sapi/apache/mod_php5.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 80be2406c7..b4884f3378 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP NEWS
?? ??? 2005, PHP 5.1 Beta 3
- Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql, to toggle
usage of buffered queries.
+- Added a SG(server_context) NULL check to php_apache_getenv. (Brian)
- Fixed bug #33491 (crash after extending MySQLi internal class). (Tony)
- Fixed bug #33475 (cURL handle is not closed on curl_close(). (Ilia)
- Fixed bug #33469 (Compile error undefined reference to ifx_checkAPI). (Jani)
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);
}
/* }}} */