Skip to content

Commit ac5bd7b

Browse files
author
me
committed
more cov
1 parent cdc23fe commit ac5bd7b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

examples/fuzz/request_parser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
99
std::error_code ec{};
1010
http::parser<http::request> parser;
1111
parser.parse(req, buf, ec);
12+
buf.clear();
13+
ec = {};
14+
http::serialize_header(req, buf, ec);
1215
return 0;
1316
}

examples/fuzz/response_parser.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44

55
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
66
{
7-
std::string buf(reinterpret_cast<const char*>(data), size);
8-
http::response req{};
9-
std::error_code ec{};
7+
std::string buf(reinterpret_cast<const char*>(data), size);
8+
http::response resp{};
9+
std::error_code ec{};
1010
http::parser<http::response> parser;
11-
parser.parse(req, buf, ec);
11+
parser.parse(resp, buf, ec);
12+
buf.clear();
13+
ec = {};
14+
http::serialize_header(resp, buf, ec);
1215
return 0;
1316
}

0 commit comments

Comments
 (0)