Coverage Report

Created: 2026-01-17 06:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/jsoncons/fuzzers/fuzz_json_cursor.cpp
Line
Count
Source
1
#include <jsoncons/json_parser.hpp>
2
#include <jsoncons/json_cursor.hpp>
3
#include <jsoncons/json.hpp>
4
5
using namespace jsoncons;
6
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size)
7
3.15k
{
8
3.15k
        std::string s(reinterpret_cast<const char*>(data), size);
9
3.15k
        std::istringstream is(s);
10
11
3.15k
        std::error_code ec;
12
3.15k
        json_stream_cursor reader(is, ec);
13
5.02k
        while (!reader.done() && !ec)
14
1.87k
        {
15
1.87k
                const auto& event = reader.current();
16
1.87k
                std::string s2 = event.get<std::string>(ec);
17
1.87k
                if (!ec)
18
1.86k
                {
19
1.86k
                    reader.next(ec);
20
1.86k
                }
21
1.87k
        }
22
23
3.15k
        return 0;
24
3.15k
}