From 5556956899a14bc0877eb99595f7412cb653552b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Loyet?= Date: Tue, 20 Apr 2010 23:28:20 +0000 Subject: Add a check request_method. If fcgi protocol is not followed, a segfault can occur. --- sapi/fpm/fpm/fpm_main.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- cgit v0.12