]> granicus.if.org Git - php/commitdiff
- Fixed bug #49677 (ini parser crashes with apache2 and using ${something} ini variables)
authorJani Taskinen <jani@php.net>
Wed, 25 Nov 2009 12:35:42 +0000 (12:35 +0000)
committerJani Taskinen <jani@php.net>
Wed, 25 Nov 2009 12:35:42 +0000 (12:35 +0000)
sapi/apache2handler/sapi_apache2.c

index 2a5e579cec10081ce3e1378e6722eeb27dbe2191..6b84a2033ddfeb05f31964e523025a04e86911ac 100644 (file)
@@ -239,6 +239,10 @@ php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC)
        php_struct *ctx = SG(server_context);
        const char *env_var;
 
+       if (ctx == NULL) {
+               return NULL;
+       }
+
        env_var = apr_table_get(ctx->r->subprocess_env, name);
 
        return (char *) env_var;