srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/fuzz/fuzz_dns.cpp
blob: da6f5f17a0c01b41d0069493686dac9117f61230 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <cstddef>
#include <cstdint>

#include "packeteer/l7/dns.hpp"

// DNS name decoding (length-prefixed labels, a historically bug-prone
// area in real-world parsers) is the main risk here - fuzz both the
// raw parser and the dissector wrapper main.cpp actually calls.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    packeteer::net::parse_dns({data, size});

    packeteer::net::DnsDissector dissector;
    dissector.summarize({data, size});
    return 0;
}