Skip to content

Commit cd69cc4

Browse files
author
pfeatherstone
committed
bit more cov
1 parent 8ad913a commit cd69cc4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/fuzz/websocket_parser.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
1313
bool is_websocket_req = req.is_websocket_req();
1414

1515
std::vector<char> msg;
16+
http::dynamic_buffer view(msg);
1617
http::websocket_parser ws_parser;
17-
ws_parser.parse(msg, buf, ec);
18+
ws_parser.parse(view, buf, ec);
1819
const auto opcode = ws_parser.get_opcode();
1920
const auto is_server = ws_parser.is_server();
20-
21+
const auto current_size = view.size();
22+
const auto current_data = view.data();
23+
const auto current_buf = view.buffer();
24+
view.resize(10);
25+
view.clear();
2126
msg.assign(data, data+size);
2227
buf.clear();
2328
http::serialize_websocket_message(boost::asio::buffer(msg), http::WS_OPCODE_DATA_BINARY, true, buf);

0 commit comments

Comments
 (0)