From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6ED5B1F463 for ; Tue, 17 Dec 2019 08:47:51 +0000 (UTC) From: Eric Wong To: cmogstored-public@bogomips.org Subject: [PATCH] test/http-parser-1: extra check for bogus methods Date: Tue, 17 Dec 2019 08:47:51 +0000 Message-Id: <20191217084751.19993-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This is in addition to test/http.rb#test_garbage --- test/http-parser-1.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/http-parser-1.c b/test/http-parser-1.c index 9865ccf..1457d24 100644 --- a/test/http-parser-1.c +++ b/test/http-parser-1.c @@ -100,6 +100,14 @@ int main(void) assert(!http->_p.usage_txt && "not a usage request"); } + if ("bogus method") { + buf_set("BOGUS /foo HTTP/1.0\r\n" + "Connection:\r\nkeep-alive\r\n" + "\r\n"); + state = mog_http_parse(http, buf, len); + assert(state == MOG_PARSER_ERROR && "parser not errored"); + } + if ("HTTP/1.1 HEAD request") { buf_set("HEAD /foo HTTP/1.1\r\n" "Host: 127.6.6.6\r\n"