Merge branch 'master' of git.bro.org:bro

This commit is contained in:
Robin Sommer 2016-03-08 07:38:49 -08:00
commit d8adcae3ba
12 changed files with 227 additions and 138 deletions

View file

@ -1209,7 +1209,15 @@ int HTTP_Analyzer::HTTP_RequestLine(const char* line, const char* end_of_line)
const char* end_of_method = get_HTTP_token(line, end_of_line);
if ( end_of_method == line )
{
// something went wrong with get_HTTP_token
// perform a weak test to see if the string "HTTP/"
// is found at the end of the RequestLine
if ( end_of_line - 9 >= line && strncasecmp(end_of_line - 9, " HTTP/", 6) == 0 )
goto bad_http_request_with_version;
goto error;
}
rest = skip_whitespace(end_of_method, end_of_line);
@ -1230,6 +1238,10 @@ int HTTP_Analyzer::HTTP_RequestLine(const char* line, const char* end_of_line)
return 1;
bad_http_request_with_version:
reporter->Weird(Conn(), "bad_HTTP_request_with_version");
return 0;
error:
reporter->Weird(Conn(), "bad_HTTP_request");
return 0;