]>
git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/fuzz_moadnsparser.cc
ea5fe25e9f7491f54c8872a013c27585b5837f26
2 * This file is part of PowerDNS or dnsdist.
3 * Copyright -- PowerDNS.COM B.V. and its contributors
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * In addition, for the avoidance of any doubt, permission is granted to
10 * link this program with OpenSSL and to (re)distribute the binaries
11 * produced as the result of such linking.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "dnsparser.hh"
24 #include "dnsrecords.hh"
34 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data
, size_t size
) {
35 static bool initialized
= false;
42 if (size
> std::numeric_limits
<uint16_t>::max()) {
47 MOADNSParser
moaQuery(true, reinterpret_cast<const char*>(data
), size
);
49 catch(const std::exception
& e
) {
51 catch(const PDNSException
& e
) {
55 MOADNSParser
moaAnswer(false, reinterpret_cast<const char*>(data
), size
);
57 catch(const std::exception
& e
) {
59 catch(const PDNSException
& e
) {