From: Jani Taskinen Date: Wed, 25 Nov 2009 12:35:42 +0000 (+0000) Subject: - Fixed bug #49677 (ini parser crashes with apache2 and using ${something} ini variables) X-Git-Tag: php-5.4.0alpha1~191^2~2342 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12803d743d74ee1112f642bcdf9d21132e9f406a;p=php - Fixed bug #49677 (ini parser crashes with apache2 and using ${something} ini variables) --- diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 2a5e579cec..6b84a2033d 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -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;