summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorJérôme Loyet <fat@php.net>2010-04-20 23:28:20 (GMT)
committerJérôme Loyet <fat@php.net>2010-04-20 23:28:20 (GMT)
commit5556956899a14bc0877eb99595f7412cb653552b (patch)
tree18d78a5a4d92ae9b0ea121f3ce14f6148320f4ad /sapi
parentca8756478a949f14cdf4e48118f2842e16bc9b12 (diff)
downloadphp-5556956899a14bc0877eb99595f7412cb653552b.tar.gz
Add a check request_method. If fcgi protocol is not followed, a segfault can occur.
Diffstat (limited to 'sapi')
-rw-r--r--sapi/fpm/fpm/fpm_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 7cc1ccd..31a9047 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1773,6 +1773,12 @@ consult the installation file that came with this distribution, or visit \n\
return FAILURE;
}
+ /* check request_method has been sent.
+ * if not, the certainly not an HTTP over fcgi request */
+ if (!SG(request_info).request_method) {
+ goto fastcgi_request_done;
+ }
+
if (!strcasecmp(SG(request_info).request_method, "GET") && fpm_status_handle_status(SG(request_info).request_uri, SG(request_info).query_string, &status_buffer, &status_content_type)) {
if (status_buffer) {
if (status_content_type) {