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.
?? ??? 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)
*/
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);
}
/* }}} */