From 09fb1ce13780543827013ebf52ef71c226484bd4 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Wed, 12 Sep 2018 09:26:59 +0000 Subject: [PATCH] Fix: Consider extra arguments in HTTP request line invalid --- httpp/httpp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/httpp/httpp.c b/httpp/httpp.c index fd1edd6..78dd1cf 100644 --- a/httpp/httpp.c +++ b/httpp/httpp.c @@ -386,6 +386,11 @@ int httpp_parse(http_parser_t *parser, const char *http_data, unsigned long len) case 2: version = &line[0][i]; break; + case 3: + /* There is an extra element in the request line. This is not HTTP. */ + free(data); + return 0; + break; } } }