From 00b9392bf5fc116cfc3f6108805ca918180fcba2 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 14 Dec 2005 03:36:44 +0000 Subject: [PATCH] Fixed bug #35571 (Fixed crash in Apache 2 SAPI when more then one php script is loaded via SSI include). --- NEWS | 2 ++ sapi/apache2handler/sapi_apache2.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8e5f792988f..58434a9feac 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,8 @@ PHP NEWS - Fixed bug #35612 (iis6 Access Violation crash). (Dmitry, alacn.uhahaa) - Fixed bug #35594 (Multiple calls to getopt() may result in a crash). (rabbitt at gmail dot com, Ilia) +- Fixed bug #35571 (Fixed crash in Apache 2 SAPI when more then one php + script is loaded via SSI include). (Ilia) - Fixed bug #35570 (segfault when re-using soap client object). (Dmitry) - Fixed bug #35558 (mktime() interpreting 3 digit years incorrectly). (Ilia) - Fixed bug #35543 (php crash when calling non existing method of a class diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 354e2b9c600..0a9ab08ac8a 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -471,7 +471,7 @@ static int php_handler(request_rec *r) /* apply_config() needs r in some cases, so allocate server_context early */ ctx = SG(server_context); - if (ctx == NULL) { + if (ctx == NULL || (ctx && ctx->request_processed && !strcmp(r->protocol, "INCLUDED"))) { normal: ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); /* register a cleanup so we clear out the SG(server_context)