From: Ilia Alshanetsky Date: Wed, 14 Dec 2005 03:38:55 +0000 (+0000) Subject: MFH: Fixed bug #35571 (Fixed crash in Apache 2 SAPI when more then one php X-Git-Tag: php-4.4.2RC2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=617ae295c337ad61f6ebe58f01f4d27b743fa9fc;p=php MFH: Fixed bug #35571 (Fixed crash in Apache 2 SAPI when more then one php script is loaded via SSI include). --- diff --git a/NEWS b/NEWS index e004e3d03e..36da8f351c 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP 4 NEWS (vovik at getart dot ru, Tony) - 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 #35536 (mysql_field_type() doesn't handle NEWDECIMAL). (Tony) - Fixed bug #35410 (wddx_deserialize() doesn't handle large ints as keys properly). (Ilia) diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 31a7a29213..ac22d652d1 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"))) { ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); /* register a cleanup so we clear out the SG(server_context) * after each request. Note: We pass in the pointer to the