From 8c3509c8944f5c6e69bbb0bf7f5f3c4aa68b3ccc Mon Sep 17 00:00:00 2001 From: Jani Taskinen Date: Wed, 25 Nov 2009 12:35:42 +0000 Subject: [PATCH] - Fixed bug #49677 (ini parser crashes with apache2 and using ${something} ini variables) --- NEWS | 2 ++ sapi/apache2handler/sapi_apache2.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 0f459b18f1..653f37eee2 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,8 @@ PHP NEWS - Fixed bug #50174 (Incorrectly matched docComment). (Felipe) - Fixed bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses containing = or ?). (Pierrick) +- Fixed bug #49677 (ini parser crashes with apache2 and using ${something} + ini variables). (Jani) - Fixed bug #49521 (PDO fetchObject sets values before calling constructor). (Pierrick) diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index afd5032586..2d224ee261 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -224,6 +224,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; -- 2.50.1