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

#include "wireframe/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) {
    wireframe::net::parse_dns({data, size});

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