prevent junk from showing up in error page in invalid requests
fixes #457
This commit is contained in:
parent
84f203fb1c
commit
3764b85514
@ -343,8 +343,12 @@ static struct request_s *process_request (struct conn_s *connptr,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* zero-terminate the strings so they don't contain junk in error page */
|
||||||
|
request->method[0] = url[0] = request->protocol[0] = 0;
|
||||||
|
|
||||||
ret = sscanf (connptr->request_line, "%[^ ] %[^ ] %[^ ]",
|
ret = sscanf (connptr->request_line, "%[^ ] %[^ ] %[^ ]",
|
||||||
request->method, url, request->protocol);
|
request->method, url, request->protocol);
|
||||||
|
|
||||||
if (ret == 2 && !strcasecmp (request->method, "GET")) {
|
if (ret == 2 && !strcasecmp (request->method, "GET")) {
|
||||||
request->protocol[0] = 0;
|
request->protocol[0] = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user