From: Ilia Alshanetsky Date: Wed, 13 Dec 2006 00:41:45 +0000 (+0000) Subject: MFB: Fixed bug #39201 (Possible crash in Apache 2 with 413 ErrorHandler). X-Git-Tag: RELEASE_1_0_0RC1~700 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d2de2426ef4ec28f476e5568d8b6cf4582cab1e;p=php MFB: Fixed bug #39201 (Possible crash in Apache 2 with 413 ErrorHandler). --- diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 715f96caa8..e181161384 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -582,8 +582,13 @@ zend_first_try { } } - /* check if comming due to ErrorDocument */ - if (parent_req && parent_req->status != HTTP_OK && strcmp(r->protocol, "INCLUDED")) { + /* + * check if comming due to ErrorDocument + * We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs + * during processing of the request by PHP during POST processing. Therefor we need to re-use the exiting + * PHP instance to handle the request rather then creating a new one. + */ + if (parent_req && parent_req->status != HTTP_OK && parent_req->status != 413 && strcmp(r->protocol, "INCLUDED")) { parent_req = NULL; goto normal; }