Skip to content

Commit 1c4806c

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #39201 (Possible crash in Apache 2 with 413 ErrorHandler).
1 parent db87e11 commit 1c4806c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

NEWS

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ PHP NEWS
125125
- Fixed bug #39398 (Booleans are not automatically translated to integers).
126126
(Ilia)
127127
- Fixed bug #39366 (imagerotate does not use alpha with angle > 45°) (Pierre)
128-
- Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the
129-
number of connection retries). (Ilia)
130-
- Fixed bug #39350 (crash with implode("\n", array(false))). (Ilia)
131-
- Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre)
132128
- Fixed bug #39364 (Removed warning on empty haystack inside mb_strstr()).
133129
(Ilia)
130+
- Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the
131+
number of connection retries). (Ilia)
134132
- Fixed bug #39354 (Allow building of curl extension against libcurl 7.16.0)
135133
(Ilia)
134+
- Fixed bug #39350 (crash with implode("\n", array(false))). (Ilia)
136135
- Fixed bug #39344 (Unnecessary calls to OnModify callback routine for
137136
an extension INI directive). (wharmby at uk dot ibm dot com, Dmitry)
138137
- Fixed bug #39320 (ZEND_HASH_APPLY_STOP causes deletion). (Marcus)
@@ -144,9 +143,12 @@ PHP NEWS
144143
given) (Pierre)
145144
- Fixed bug #39265 (Fixed path handling inside mod_files.sh).
146145
(michal dot taborsky at gmail dot com, Ilia)
146+
- Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre)
147147
- Fixed bug #39217 (serialNumber might be -1 when the value is too large)
148148
(Pierre, Tony)
149149
- Fixed bug #39215 (Inappropriate close of stdin/stdout/stderr). (Wez,Ilia)
150+
- Fixed bug #39201 (Possible crash in Apache 2 with 413 ErrorHandler).
151+
(Ilia)
150152
- Fixed bug #39151 (Parse error in recursiveiteratoriterator.php). (Marcus)
151153
- Fixed bug #39121 (Incorrect return array handling in non-wsdl soap client).
152154
(Dmitry)

sapi/apache2handler/sapi_apache2.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,13 @@ zend_first_try {
587587
}
588588
}
589589

590-
/* check if comming due to ErrorDocument */
591-
if (parent_req && parent_req->status != HTTP_OK && strcmp(r->protocol, "INCLUDED")) {
590+
/*
591+
* check if comming due to ErrorDocument
592+
* We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs
593+
* during processing of the request by PHP during POST processing. Therefor we need to re-use the exiting
594+
* PHP instance to handle the request rather then creating a new one.
595+
*/
596+
if (parent_req && parent_req->status != HTTP_OK && parent_req->status != 413 && strcmp(r->protocol, "INCLUDED")) {
592597
parent_req = NULL;
593598
goto normal;
594599
}

0 commit comments

Comments
 (0)