MCPcopy Create free account
hub / github.com/boostorg/beast / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

test/fuzz/http_response.cpp:11–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <boost/beast/_experimental/test/stream.hpp>
10
11extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
12{
13 using namespace boost::beast;
14
15 error_code ec;
16 flat_buffer buffer;
17 net::io_context ioc;
18 test::stream stream{ioc, {reinterpret_cast<const char*>(data), size}};
19 stream.close_remote();
20
21 http::chunk_extensions ce;
22 http::response_parser<http::dynamic_body> parser;
23
24 auto chunk_header_cb = [&ce](std::uint64_t, string_view extensions, error_code& ev)
25 {
26 ce.parse(extensions, ev);
27 };
28
29 parser.on_chunk_header(chunk_header_cb);
30 http::read(stream, buffer, parser, ec);
31
32 return 0;
33}

Callers

nothing calls this directly

Calls 1

readFunction · 0.50

Tested by

no test coverage detected