summaryrefslogtreecommitdiffstats
path: root/fuzz
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fuzz/FUZZING.md37
-rw-r--r--fuzz/Makefile.in55
-rw-r--r--fuzz/dns_master_load.in/generate-counter-overflow.dbbin0 -> 47 bytes
-rw-r--r--fuzz/dns_name_fromtext_target.c45
-rw-r--r--fuzz/dns_name_fromtext_target.in/example.com1
-rw-r--r--fuzz/dns_rdata_fromtext.in/svbc-max-token1
-rw-r--r--fuzz/dns_rdata_fromwire_text.c225
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/cdnskeybin0 -> 20 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-0bin0 -> 15 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-1bin0 -> 7 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-10bin0 -> 77 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-100bin0 -> 12 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-101bin0 -> 25 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-102bin0 -> 26 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-103bin0 -> 44 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-104bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-105bin0 -> 22 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-106bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-107bin0 -> 31 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-108bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-109bin0 -> 68 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-11bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-110bin0 -> 71 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-111bin0 -> 84 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-112bin0 -> 69 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-113bin0 -> 93 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-114bin0 -> 57 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-115bin0 -> 57 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-116bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-117bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-118bin0 -> 115 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-119bin0 -> 57 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-12bin0 -> 8 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-120bin0 -> 126 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-121bin0 -> 110 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-122bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-123bin0 -> 25 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-124bin0 -> 65 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-125bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-126bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-127bin0 -> 48 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-128bin0 -> 56 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-129bin0 -> 26 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-13bin0 -> 30 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-130bin0 -> 60 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-131bin0 -> 51 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-132bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-133bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-134bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-135bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-136bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-137bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-138bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-139bin0 -> 51 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-14bin0 -> 38 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-140bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-141bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-142bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-1431
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-15bin0 -> 7 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-16bin0 -> 5 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-171
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-18bin0 -> 23 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-19bin0 -> 22 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-21
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-20bin0 -> 151 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-21bin0 -> 75 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-22bin0 -> 19 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-23bin0 -> 12 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-24bin0 -> 8 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-25bin0 -> 15 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-26bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-27bin0 -> 7 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-28bin0 -> 8 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-29bin0 -> 8 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-3bin0 -> 72 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-30bin0 -> 33 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-31bin0 -> 37 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-321
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-33bin0 -> 11 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-34bin0 -> 7 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-35bin0 -> 12 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-36bin0 -> 10 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-37bin0 -> 66 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-38bin0 -> 66 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-391
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-4bin0 -> 5 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-40bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-41bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-42bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-43bin0 -> 30 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-44bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-45bin0 -> 38 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-46bin0 -> 23 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-47bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-48bin0 -> 54 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-49bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-51
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-501
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-51bin0 -> 12 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-52bin0 -> 6 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-531
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-54bin0 -> 83 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-55bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-56bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-57bin0 -> 49 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-58bin0 -> 38 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-59bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-6bin0 -> 5 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-60bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-61bin0 -> 29 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-62bin0 -> 28 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-63bin0 -> 23 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-64bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-65bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-66bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-67bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-68bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-69bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-7bin0 -> 9 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-70bin0 -> 27 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-71bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-72bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-73bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-74bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-75bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-76bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-77bin0 -> 8 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-78bin0 -> 12 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-79bin0 -> 9 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-8bin0 -> 67 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-80bin0 -> 11 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-81bin0 -> 11 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-82bin0 -> 12 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-83bin0 -> 15 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-84bin0 -> 9 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-85bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-86bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-87bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-88bin0 -> 36 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-89bin0 -> 63 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-91
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-90bin0 -> 74 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-91bin0 -> 42 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-92bin0 -> 74 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-93bin0 -> 48 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-94bin0 -> 23 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-95bin0 -> 21 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-96bin0 -> 11 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-97bin0 -> 17 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-98bin0 -> 50 bytes
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/input-991
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/smimea1
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/sshfp1
-rw-r--r--fuzz/dns_rdata_fromwire_text.in/svcbbin0 -> 39 bytes
-rw-r--r--fuzz/fuzz.h33
-rw-r--r--fuzz/main.c145
157 files changed, 554 insertions, 0 deletions
diff --git a/fuzz/FUZZING.md b/fuzz/FUZZING.md
new file mode 100644
index 0000000..65363e1
--- /dev/null
+++ b/fuzz/FUZZING.md
@@ -0,0 +1,37 @@
+<!--
+Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+
+SPDX-License-Identifier: MPL-2.0
+
+This Source Code Form is subject to the terms of the Mozilla Public
+License, v. 2.0. If a copy of the MPL was not distributed with this
+file, you can obtain one at https://mozilla.org/MPL/2.0/.
+
+See the COPYRIGHT file distributed with this work for additional
+information regarding copyright ownership.
+-->
+
+= Fuzzing
+
+The tests in this directory can be operated in three modes:
+
+* non-fuzzing - the test just runs over all input located in `<test_name>.in/`
+ directory by compiling with mock main.c that walks through the directory and
+ runs `LLVMFuzzerTestOneInput()` over the input files
+* AFL - `./configure --with-fuzzing=afl` will either feed the stdin to
+ `LLVMFuzzerTestOneInput()` or run the `__AFL_LOOP(10000)` if compiled with
+ `afl-clang-fast`
+* LibFuzzer - `./configure --with-fuzzing=libfuzzer` will disable `main.c`
+ completely and it uses the standard LibFuzzer mechanims to feed
+ `LLVMFuzzerTestOneInput` with the fuzzer
+
+== Test Cases
+
+Each test case should be called descriptively and the executable target must
+link `testcase.o` and `main.o` and the `test_case.c` must have a function
+`LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)`.
+
+== Adding more fuzzers
+
+To add a different fuzzer, `main.c` must be modified to include `main()` function
+for a specific fuzzer (or no function as is case with LibFuzzer).
diff --git a/fuzz/Makefile.in b/fuzz/Makefile.in
new file mode 100644
index 0000000..e62ed15
--- /dev/null
+++ b/fuzz/Makefile.in
@@ -0,0 +1,55 @@
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+abs_srcdir = @abs_srcdir@
+
+@BIND9_MAKE_INCLUDES@
+
+CINCLUDES = -I. -I.. ${DNS_INCLUDES} ${ISC_INCLUDES} \
+ ${OPENSSL_CFLAGS}
+CDEFINES = -DFUZZDIR=\"$(abs_srcdir)\"
+
+ISCLIBS = ../lib/isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@
+ISCDEPLIBS = ../lib/isc/libisc.@A@
+DNSLIBS = ../lib/dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@
+DNSDEPLIBS = ../lib/dns/libdns.@A@
+
+LIBS = @LIBS@
+
+OBJS = main.@O@
+SRCS = main.c dns_name_fromtext_target.c dns_rdata_fromwire_text.c
+
+SUBDIRS =
+TARGETS = dns_name_fromtext_target@EXEEXT@ \
+ dns_rdata_fromwire_text@EXEEXT@
+
+@BIND9_MAKE_RULES@
+
+dns_name_fromtext_target@EXEEXT@: dns_name_fromtext_target.@O@ main.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
+ dns_name_fromtext_target.@O@ main.@O@ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+dns_rdata_fromwire_text@EXEEXT@: dns_rdata_fromwire_text.@O@ main.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
+ dns_rdata_fromwire_text.@O@ main.@O@ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+check: ${TARGETS}
+ for fuzzer in ${TARGETS}; do \
+ ./$${fuzzer} ; \
+ done
+
+oss-fuzz: ${TARGETS}
+
+clean distclean::
+ rm -f ${TARGETS}
diff --git a/fuzz/dns_master_load.in/generate-counter-overflow.db b/fuzz/dns_master_load.in/generate-counter-overflow.db
new file mode 100644
index 0000000..590c0d5
--- /dev/null
+++ b/fuzz/dns_master_load.in/generate-counter-overflow.db
Binary files differ
diff --git a/fuzz/dns_name_fromtext_target.c b/fuzz/dns_name_fromtext_target.c
new file mode 100644
index 0000000..a9db90f
--- /dev/null
+++ b/fuzz/dns_name_fromtext_target.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <isc/buffer.h>
+#include <isc/util.h>
+
+#include <dns/fixedname.h>
+#include <dns/name.h>
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ isc_buffer_t buf;
+ isc_result_t result;
+ dns_fixedname_t origin;
+ char *de_const;
+
+ if (size < 5) {
+ return (0);
+ }
+
+ dns_fixedname_init(&origin);
+ DE_CONST(data, de_const);
+ isc_buffer_init(&buf, (void *)de_const, size);
+ isc_buffer_add(&buf, size);
+ result = dns_name_fromtext(dns_fixedname_name(&origin), &buf,
+ dns_rootname, 0, NULL);
+ UNUSED(result);
+ return (0);
+}
diff --git a/fuzz/dns_name_fromtext_target.in/example.com b/fuzz/dns_name_fromtext_target.in/example.com
new file mode 100644
index 0000000..de54ac6
--- /dev/null
+++ b/fuzz/dns_name_fromtext_target.in/example.com
@@ -0,0 +1 @@
+example.com
diff --git a/fuzz/dns_rdata_fromtext.in/svbc-max-token b/fuzz/dns_rdata_fromtext.in/svbc-max-token
new file mode 100644
index 0000000..6d1a265
--- /dev/null
+++ b/fuzz/dns_rdata_fromtext.in/svbc-max-token
@@ -0,0 +1 @@
+1 65 8 . aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=
diff --git a/fuzz/dns_rdata_fromwire_text.c b/fuzz/dns_rdata_fromwire_text.c
new file mode 100644
index 0000000..d60d370
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.c
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <isc/buffer.h>
+#include <isc/lex.h>
+#include <isc/mem.h>
+#include <isc/result.h>
+#include <isc/util.h>
+
+#include <dns/callbacks.h>
+#include <dns/compress.h>
+#include <dns/master.h>
+#include <dns/rdata.h>
+#include <dns/rdatatype.h>
+
+#define CHECK(x) \
+ ({ \
+ if ((result = (x)) != ISC_R_SUCCESS) \
+ goto done; \
+ })
+
+extern bool debug;
+
+/*
+ * Fuzz input to dns_rdata_fromwire(). Then convert the result
+ * to text, back to wire format, to multiline text, and back to wire
+ * format again, checking for consistency throughout the sequence.
+ */
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+static void
+nullmsg(dns_rdatacallbacks_t *cb, const char *fmt, ...) {
+ va_list args;
+
+ UNUSED(cb);
+
+ if (debug) {
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+ }
+}
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ char totext[64 * 1044 * 4];
+ dns_compress_t cctx;
+ dns_decompress_t dctx;
+ dns_rdatatype_t rdtype;
+ dns_rdataclass_t rdclass;
+ dns_rdatatype_t typelist[256] = { 1000 }; /* unknown */
+ dns_rdataclass_t classlist[] = { dns_rdataclass_in, dns_rdataclass_hs,
+ dns_rdataclass_ch, dns_rdataclass_any,
+ 60 };
+ dns_rdata_t rdata1 = DNS_RDATA_INIT, rdata2 = DNS_RDATA_INIT,
+ rdata3 = DNS_RDATA_INIT;
+ dns_rdatacallbacks_t callbacks;
+ isc_buffer_t source, target;
+ isc_lex_t *lex = NULL;
+ isc_lexspecials_t specials;
+ isc_mem_t *mctx = NULL;
+ isc_result_t result;
+ unsigned char fromtext[1024];
+ unsigned char fromwire[1024];
+ unsigned char towire[1024];
+ unsigned int classes = (sizeof(classlist) / sizeof(classlist[0]));
+ unsigned int types = 1, flags, t;
+
+ /*
+ * First 2 bytes are used to select type and class.
+ * dns_rdata_fromwire() only accepts input up to 2^16-1 octets.
+ */
+ if (size < 2 || size > 0xffff + 2) {
+ return (0);
+ }
+
+ /*
+ * Append known types to list.
+ */
+ for (t = 1; t <= 0x10000; t++) {
+ char typebuf[256];
+ if (dns_rdatatype_ismeta(t)) {
+ continue;
+ }
+ dns_rdatatype_format(t, typebuf, sizeof(typebuf));
+ if (strncmp(typebuf, "TYPE", 4) != 0) {
+ /* Assert when we need to grow typelist. */
+ assert(types < sizeof(typelist) / sizeof(typelist[0]));
+ typelist[types++] = t;
+ }
+ }
+
+ /*
+ * Random type and class from a limited set.
+ */
+ rdtype = typelist[(*data++) % types];
+ size--;
+ rdclass = classlist[(*data++) % classes];
+ size--;
+
+ isc_mem_create(&mctx);
+
+ CHECK(isc_lex_create(mctx, 64, &lex));
+ memset(specials, 0, sizeof(specials));
+ specials[0] = 1;
+ specials['('] = 1;
+ specials[')'] = 1;
+ specials['"'] = 1;
+ isc_lex_setspecials(lex, specials);
+ isc_lex_setcomments(lex, ISC_LEXCOMMENT_DNSMASTERFILE);
+
+ if (debug) {
+ fprintf(stderr, "type=%u, class=%u\n", rdtype, rdclass);
+ }
+
+ dns_rdatacallbacks_init(&callbacks);
+ callbacks.warn = callbacks.error = nullmsg;
+
+ /* Disallow decompression as we are reading a packet */
+ dns_decompress_init(&dctx, -1, DNS_DECOMPRESS_NONE);
+
+ isc_buffer_constinit(&source, data, size);
+ isc_buffer_add(&source, size);
+ isc_buffer_setactive(&source, size);
+
+ isc_buffer_init(&target, fromwire, sizeof(fromwire));
+
+ /*
+ * Reject invalid rdata.
+ */
+ CHECK(dns_rdata_fromwire(&rdata1, rdclass, rdtype, &source, &dctx, 0,
+ &target));
+ assert(rdata1.length == size);
+
+ /*
+ * Convert to text from wire.
+ */
+ isc_buffer_init(&target, totext, sizeof(totext) - 1);
+ result = dns_rdata_totext(&rdata1, NULL, &target);
+ assert(result == ISC_R_SUCCESS);
+
+ /*
+ * Make debugging easier by NUL terminating.
+ */
+ totext[isc_buffer_usedlength(&target)] = 0;
+
+ /*
+ * Convert to wire from text.
+ */
+ isc_buffer_constinit(&source, totext, isc_buffer_usedlength(&target));
+ isc_buffer_add(&source, isc_buffer_usedlength(&target));
+ CHECK(isc_lex_openbuffer(lex, &source));
+
+ isc_buffer_init(&target, fromtext, sizeof(fromtext));
+ result = dns_rdata_fromtext(&rdata2, rdclass, rdtype, lex, dns_rootname,
+ 0, mctx, &target, &callbacks);
+ if (debug && result != ISC_R_SUCCESS) {
+ fprintf(stderr, "'%s'\n", totext);
+ }
+ assert(result == ISC_R_SUCCESS);
+ assert(rdata2.length == size);
+ assert(!memcmp(rdata2.data, data, size));
+
+ /*
+ * Convert to multi-line text from wire.
+ */
+ isc_buffer_init(&target, totext, sizeof(totext));
+ flags = dns_master_styleflags(&dns_master_style_default);
+ result = dns_rdata_tofmttext(&rdata1, dns_rootname, flags, 80 - 32, 4,
+ "\n", &target);
+ assert(result == ISC_R_SUCCESS);
+
+ /*
+ * Convert to wire from text.
+ */
+ isc_buffer_constinit(&source, totext, isc_buffer_usedlength(&target));
+ isc_buffer_add(&source, isc_buffer_usedlength(&target));
+ CHECK(isc_lex_openbuffer(lex, &source));
+
+ isc_buffer_init(&target, fromtext, sizeof(fromtext));
+ result = dns_rdata_fromtext(&rdata3, rdclass, rdtype, lex, dns_rootname,
+ 0, mctx, &target, &callbacks);
+ assert(result == ISC_R_SUCCESS);
+ assert(rdata3.length == size);
+ assert(!memcmp(rdata3.data, data, size));
+
+ /*
+ * Convert rdata back to wire.
+ */
+ CHECK(dns_compress_init(&cctx, -1, mctx));
+ dns_compress_disable(&cctx);
+ isc_buffer_init(&target, towire, sizeof(towire));
+ result = dns_rdata_towire(&rdata1, &cctx, &target);
+ dns_compress_invalidate(&cctx);
+ assert(result == ISC_R_SUCCESS);
+ assert(target.used == size);
+ assert(!memcmp(target.base, data, size));
+
+done:
+ if (lex != NULL) {
+ isc_lex_destroy(&lex);
+ }
+ if (lex != NULL) {
+ isc_mem_detach(&mctx);
+ }
+ return (0);
+}
diff --git a/fuzz/dns_rdata_fromwire_text.in/cdnskey b/fuzz/dns_rdata_fromwire_text.in/cdnskey
new file mode 100644
index 0000000..9eb47d5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/cdnskey
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-0 b/fuzz/dns_rdata_fromwire_text.in/input-0
new file mode 100644
index 0000000..67264cf
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-0
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-1 b/fuzz/dns_rdata_fromwire_text.in/input-1
new file mode 100644
index 0000000..ae8e0b9
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-1
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-10 b/fuzz/dns_rdata_fromwire_text.in/input-10
new file mode 100644
index 0000000..2a39348
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-10
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-100 b/fuzz/dns_rdata_fromwire_text.in/input-100
new file mode 100644
index 0000000..5a527cd
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-100
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-101 b/fuzz/dns_rdata_fromwire_text.in/input-101
new file mode 100644
index 0000000..1d3d6a2
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-101
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-102 b/fuzz/dns_rdata_fromwire_text.in/input-102
new file mode 100644
index 0000000..b800c4c
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-102
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-103 b/fuzz/dns_rdata_fromwire_text.in/input-103
new file mode 100644
index 0000000..c0ca9c0
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-103
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-104 b/fuzz/dns_rdata_fromwire_text.in/input-104
new file mode 100644
index 0000000..5c39be4
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-104
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-105 b/fuzz/dns_rdata_fromwire_text.in/input-105
new file mode 100644
index 0000000..754d0f2
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-105
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-106 b/fuzz/dns_rdata_fromwire_text.in/input-106
new file mode 100644
index 0000000..af4bdc5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-106
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-107 b/fuzz/dns_rdata_fromwire_text.in/input-107
new file mode 100644
index 0000000..8ddc502
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-107
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-108 b/fuzz/dns_rdata_fromwire_text.in/input-108
new file mode 100644
index 0000000..a328093
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-108
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-109 b/fuzz/dns_rdata_fromwire_text.in/input-109
new file mode 100644
index 0000000..b566c0b
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-109
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-11 b/fuzz/dns_rdata_fromwire_text.in/input-11
new file mode 100644
index 0000000..21ca619
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-11
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-110 b/fuzz/dns_rdata_fromwire_text.in/input-110
new file mode 100644
index 0000000..b55551a
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-110
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-111 b/fuzz/dns_rdata_fromwire_text.in/input-111
new file mode 100644
index 0000000..7e4fcd1
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-111
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-112 b/fuzz/dns_rdata_fromwire_text.in/input-112
new file mode 100644
index 0000000..c351052
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-112
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-113 b/fuzz/dns_rdata_fromwire_text.in/input-113
new file mode 100644
index 0000000..6159786
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-113
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-114 b/fuzz/dns_rdata_fromwire_text.in/input-114
new file mode 100644
index 0000000..a709d51
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-114
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-115 b/fuzz/dns_rdata_fromwire_text.in/input-115
new file mode 100644
index 0000000..a6a21c1
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-115
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-116 b/fuzz/dns_rdata_fromwire_text.in/input-116
new file mode 100644
index 0000000..248105b
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-116
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-117 b/fuzz/dns_rdata_fromwire_text.in/input-117
new file mode 100644
index 0000000..82fe403
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-117
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-118 b/fuzz/dns_rdata_fromwire_text.in/input-118
new file mode 100644
index 0000000..0b6136e
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-118
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-119 b/fuzz/dns_rdata_fromwire_text.in/input-119
new file mode 100644
index 0000000..bb8cd98
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-119
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-12 b/fuzz/dns_rdata_fromwire_text.in/input-12
new file mode 100644
index 0000000..e51156b
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-12
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-120 b/fuzz/dns_rdata_fromwire_text.in/input-120
new file mode 100644
index 0000000..0e0b607
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-120
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-121 b/fuzz/dns_rdata_fromwire_text.in/input-121
new file mode 100644
index 0000000..8671167
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-121
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-122 b/fuzz/dns_rdata_fromwire_text.in/input-122
new file mode 100644
index 0000000..90d058c
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-122
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-123 b/fuzz/dns_rdata_fromwire_text.in/input-123
new file mode 100644
index 0000000..9728ae9
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-123
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-124 b/fuzz/dns_rdata_fromwire_text.in/input-124
new file mode 100644
index 0000000..7a54801
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-124
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-125 b/fuzz/dns_rdata_fromwire_text.in/input-125
new file mode 100644
index 0000000..90e2175
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-125
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-126 b/fuzz/dns_rdata_fromwire_text.in/input-126
new file mode 100644
index 0000000..04a84f4
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-126
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-127 b/fuzz/dns_rdata_fromwire_text.in/input-127
new file mode 100644
index 0000000..b7b8446
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-127
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-128 b/fuzz/dns_rdata_fromwire_text.in/input-128
new file mode 100644
index 0000000..bd581cd
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-128
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-129 b/fuzz/dns_rdata_fromwire_text.in/input-129
new file mode 100644
index 0000000..f80c669
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-129
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-13 b/fuzz/dns_rdata_fromwire_text.in/input-13
new file mode 100644
index 0000000..0c4f452
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-13
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-130 b/fuzz/dns_rdata_fromwire_text.in/input-130
new file mode 100644
index 0000000..00d9438
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-130
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-131 b/fuzz/dns_rdata_fromwire_text.in/input-131
new file mode 100644
index 0000000..b5377d3
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-131
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-132 b/fuzz/dns_rdata_fromwire_text.in/input-132
new file mode 100644
index 0000000..2866ed0
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-132
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-133 b/fuzz/dns_rdata_fromwire_text.in/input-133
new file mode 100644
index 0000000..d6ca8c8
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-133
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-134 b/fuzz/dns_rdata_fromwire_text.in/input-134
new file mode 100644
index 0000000..bee8307
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-134
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-135 b/fuzz/dns_rdata_fromwire_text.in/input-135
new file mode 100644
index 0000000..91efead
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-135
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-136 b/fuzz/dns_rdata_fromwire_text.in/input-136
new file mode 100644
index 0000000..f7b1843
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-136
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-137 b/fuzz/dns_rdata_fromwire_text.in/input-137
new file mode 100644
index 0000000..2bd7066
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-137
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-138 b/fuzz/dns_rdata_fromwire_text.in/input-138
new file mode 100644
index 0000000..ea08340
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-138
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-139 b/fuzz/dns_rdata_fromwire_text.in/input-139
new file mode 100644
index 0000000..e95cbf5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-139
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-14 b/fuzz/dns_rdata_fromwire_text.in/input-14
new file mode 100644
index 0000000..bde6b15
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-14
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-140 b/fuzz/dns_rdata_fromwire_text.in/input-140
new file mode 100644
index 0000000..25be408
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-140
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-141 b/fuzz/dns_rdata_fromwire_text.in/input-141
new file mode 100644
index 0000000..0b2d0d6
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-141
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-142 b/fuzz/dns_rdata_fromwire_text.in/input-142
new file mode 100644
index 0000000..ca87de0
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-142
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-143 b/fuzz/dns_rdata_fromwire_text.in/input-143
new file mode 100644
index 0000000..1a3e0ac
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-143
@@ -0,0 +1 @@
+d$3ÿê \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-15 b/fuzz/dns_rdata_fromwire_text.in/input-15
new file mode 100644
index 0000000..72df49c
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-15
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-16 b/fuzz/dns_rdata_fromwire_text.in/input-16
new file mode 100644
index 0000000..b80f63f
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-16
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-17 b/fuzz/dns_rdata_fromwire_text.in/input-17
new file mode 100644
index 0000000..cc63d40
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-17
@@ -0,0 +1 @@
+d®#®®®®®®®®®®®®®®®®®®®®®Ä®®®®®d®®®®®d \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-18 b/fuzz/dns_rdata_fromwire_text.in/input-18
new file mode 100644
index 0000000..4a0d214
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-18
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-19 b/fuzz/dns_rdata_fromwire_text.in/input-19
new file mode 100644
index 0000000..4ef39ef
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-19
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-2 b/fuzz/dns_rdata_fromwire_text.in/input-2
new file mode 100644
index 0000000..cecf923
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-2
@@ -0,0 +1 @@
+4A-ò \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-20 b/fuzz/dns_rdata_fromwire_text.in/input-20
new file mode 100644
index 0000000..52c3851
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-20
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-21 b/fuzz/dns_rdata_fromwire_text.in/input-21
new file mode 100644
index 0000000..0cc97d6
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-21
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-22 b/fuzz/dns_rdata_fromwire_text.in/input-22
new file mode 100644
index 0000000..d993d48
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-22
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-23 b/fuzz/dns_rdata_fromwire_text.in/input-23
new file mode 100644
index 0000000..38cbee6
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-23
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-24 b/fuzz/dns_rdata_fromwire_text.in/input-24
new file mode 100644
index 0000000..a45779e
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-24
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-25 b/fuzz/dns_rdata_fromwire_text.in/input-25
new file mode 100644
index 0000000..2d9f2ce
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-25
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-26 b/fuzz/dns_rdata_fromwire_text.in/input-26
new file mode 100644
index 0000000..a392076
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-26
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-27 b/fuzz/dns_rdata_fromwire_text.in/input-27
new file mode 100644
index 0000000..f75f8d9
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-27
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-28 b/fuzz/dns_rdata_fromwire_text.in/input-28
new file mode 100644
index 0000000..005ae77
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-28
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-29 b/fuzz/dns_rdata_fromwire_text.in/input-29
new file mode 100644
index 0000000..b9c69e1
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-29
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-3 b/fuzz/dns_rdata_fromwire_text.in/input-3
new file mode 100644
index 0000000..606dc1b
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-3
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-30 b/fuzz/dns_rdata_fromwire_text.in/input-30
new file mode 100644
index 0000000..e106d54
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-30
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-31 b/fuzz/dns_rdata_fromwire_text.in/input-31
new file mode 100644
index 0000000..dc5bf2b
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-31
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-32 b/fuzz/dns_rdata_fromwire_text.in/input-32
new file mode 100644
index 0000000..1297a7e
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-32
@@ -0,0 +1 @@
+déé \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-33 b/fuzz/dns_rdata_fromwire_text.in/input-33
new file mode 100644
index 0000000..b6d57bb
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-33
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-34 b/fuzz/dns_rdata_fromwire_text.in/input-34
new file mode 100644
index 0000000..fef669d
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-34
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-35 b/fuzz/dns_rdata_fromwire_text.in/input-35
new file mode 100644
index 0000000..94a4a37
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-35
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-36 b/fuzz/dns_rdata_fromwire_text.in/input-36
new file mode 100644
index 0000000..dab603c
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-36
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-37 b/fuzz/dns_rdata_fromwire_text.in/input-37
new file mode 100644
index 0000000..51f4124
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-37
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-38 b/fuzz/dns_rdata_fromwire_text.in/input-38
new file mode 100644
index 0000000..1ad3023
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-38
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-39 b/fuzz/dns_rdata_fromwire_text.in/input-39
new file mode 100644
index 0000000..b8dfecd
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-39
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-4 b/fuzz/dns_rdata_fromwire_text.in/input-4
new file mode 100644
index 0000000..ae6730e
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-4
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-40 b/fuzz/dns_rdata_fromwire_text.in/input-40
new file mode 100644
index 0000000..5ab3557
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-40
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-41 b/fuzz/dns_rdata_fromwire_text.in/input-41
new file mode 100644
index 0000000..ea33ca7
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-41
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-42 b/fuzz/dns_rdata_fromwire_text.in/input-42
new file mode 100644
index 0000000..eb63067
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-42
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-43 b/fuzz/dns_rdata_fromwire_text.in/input-43
new file mode 100644
index 0000000..9aa3747
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-43
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-44 b/fuzz/dns_rdata_fromwire_text.in/input-44
new file mode 100644
index 0000000..bdc8b9d
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-44
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-45 b/fuzz/dns_rdata_fromwire_text.in/input-45
new file mode 100644
index 0000000..e6966b5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-45
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-46 b/fuzz/dns_rdata_fromwire_text.in/input-46
new file mode 100644
index 0000000..1156424
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-46
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-47 b/fuzz/dns_rdata_fromwire_text.in/input-47
new file mode 100644
index 0000000..b499172
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-47
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-48 b/fuzz/dns_rdata_fromwire_text.in/input-48
new file mode 100644
index 0000000..7ab447b
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-48
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-49 b/fuzz/dns_rdata_fromwire_text.in/input-49
new file mode 100644
index 0000000..ab5e3b0
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-49
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-5 b/fuzz/dns_rdata_fromwire_text.in/input-5
new file mode 100644
index 0000000..4f0acdc
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-5
@@ -0,0 +1 @@
+„Ë›› \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-50 b/fuzz/dns_rdata_fromwire_text.in/input-50
new file mode 100644
index 0000000..5f43a46
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-50
@@ -0,0 +1 @@
+µ|8‡‡¶|¶|8¶|¶|8 \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-51 b/fuzz/dns_rdata_fromwire_text.in/input-51
new file mode 100644
index 0000000..880c12c
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-51
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-52 b/fuzz/dns_rdata_fromwire_text.in/input-52
new file mode 100644
index 0000000..50a22af
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-52
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-53 b/fuzz/dns_rdata_fromwire_text.in/input-53
new file mode 100644
index 0000000..95243a6
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-53
@@ -0,0 +1 @@
+ñ( \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-54 b/fuzz/dns_rdata_fromwire_text.in/input-54
new file mode 100644
index 0000000..b501920
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-54
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-55 b/fuzz/dns_rdata_fromwire_text.in/input-55
new file mode 100644
index 0000000..59b9f03
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-55
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-56 b/fuzz/dns_rdata_fromwire_text.in/input-56
new file mode 100644
index 0000000..b0beba0
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-56
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-57 b/fuzz/dns_rdata_fromwire_text.in/input-57
new file mode 100644
index 0000000..24f40a5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-57
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-58 b/fuzz/dns_rdata_fromwire_text.in/input-58
new file mode 100644
index 0000000..aca62bb
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-58
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-59 b/fuzz/dns_rdata_fromwire_text.in/input-59
new file mode 100644
index 0000000..3388b2d
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-59
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-6 b/fuzz/dns_rdata_fromwire_text.in/input-6
new file mode 100644
index 0000000..889a2bd
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-6
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-60 b/fuzz/dns_rdata_fromwire_text.in/input-60
new file mode 100644
index 0000000..ac328d9
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-60
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-61 b/fuzz/dns_rdata_fromwire_text.in/input-61
new file mode 100644
index 0000000..08ad070
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-61
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-62 b/fuzz/dns_rdata_fromwire_text.in/input-62
new file mode 100644
index 0000000..18a05e5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-62
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-63 b/fuzz/dns_rdata_fromwire_text.in/input-63
new file mode 100644
index 0000000..959fdaf
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-63
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-64 b/fuzz/dns_rdata_fromwire_text.in/input-64
new file mode 100644
index 0000000..5d9c569
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-64
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-65 b/fuzz/dns_rdata_fromwire_text.in/input-65
new file mode 100644
index 0000000..2d9c1fc
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-65
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-66 b/fuzz/dns_rdata_fromwire_text.in/input-66
new file mode 100644
index 0000000..f78d393
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-66
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-67 b/fuzz/dns_rdata_fromwire_text.in/input-67
new file mode 100644
index 0000000..95efb96
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-67
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-68 b/fuzz/dns_rdata_fromwire_text.in/input-68
new file mode 100644
index 0000000..e913515
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-68
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-69 b/fuzz/dns_rdata_fromwire_text.in/input-69
new file mode 100644
index 0000000..c8046b5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-69
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-7 b/fuzz/dns_rdata_fromwire_text.in/input-7
new file mode 100644
index 0000000..e52f460
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-7
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-70 b/fuzz/dns_rdata_fromwire_text.in/input-70
new file mode 100644
index 0000000..92a7128
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-70
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-71 b/fuzz/dns_rdata_fromwire_text.in/input-71
new file mode 100644
index 0000000..5fc383e
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-71
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-72 b/fuzz/dns_rdata_fromwire_text.in/input-72
new file mode 100644
index 0000000..7759c47
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-72
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-73 b/fuzz/dns_rdata_fromwire_text.in/input-73
new file mode 100644
index 0000000..872fee9
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-73
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-74 b/fuzz/dns_rdata_fromwire_text.in/input-74
new file mode 100644
index 0000000..6d6ec93
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-74
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-75 b/fuzz/dns_rdata_fromwire_text.in/input-75
new file mode 100644
index 0000000..47a9f2b
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-75
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-76 b/fuzz/dns_rdata_fromwire_text.in/input-76
new file mode 100644
index 0000000..0a02761
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-76
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-77 b/fuzz/dns_rdata_fromwire_text.in/input-77
new file mode 100644
index 0000000..44d445a
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-77
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-78 b/fuzz/dns_rdata_fromwire_text.in/input-78
new file mode 100644
index 0000000..2893517
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-78
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-79 b/fuzz/dns_rdata_fromwire_text.in/input-79
new file mode 100644
index 0000000..c83c4bd
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-79
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-8 b/fuzz/dns_rdata_fromwire_text.in/input-8
new file mode 100644
index 0000000..4d60fdf
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-8
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-80 b/fuzz/dns_rdata_fromwire_text.in/input-80
new file mode 100644
index 0000000..5da0971
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-80
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-81 b/fuzz/dns_rdata_fromwire_text.in/input-81
new file mode 100644
index 0000000..c3b5aff
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-81
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-82 b/fuzz/dns_rdata_fromwire_text.in/input-82
new file mode 100644
index 0000000..0e862c6
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-82
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-83 b/fuzz/dns_rdata_fromwire_text.in/input-83
new file mode 100644
index 0000000..7f49b5f
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-83
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-84 b/fuzz/dns_rdata_fromwire_text.in/input-84
new file mode 100644
index 0000000..417471d
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-84
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-85 b/fuzz/dns_rdata_fromwire_text.in/input-85
new file mode 100644
index 0000000..2e6a9ea
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-85
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-86 b/fuzz/dns_rdata_fromwire_text.in/input-86
new file mode 100644
index 0000000..1eb09cc
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-86
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-87 b/fuzz/dns_rdata_fromwire_text.in/input-87
new file mode 100644
index 0000000..4c29c23
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-87
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-88 b/fuzz/dns_rdata_fromwire_text.in/input-88
new file mode 100644
index 0000000..28ac529
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-88
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-89 b/fuzz/dns_rdata_fromwire_text.in/input-89
new file mode 100644
index 0000000..8119bf0
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-89
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-9 b/fuzz/dns_rdata_fromwire_text.in/input-9
new file mode 100644
index 0000000..72a140c
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-9
@@ -0,0 +1 @@
+222222'œœœœœœœœœœœœœœœœœ222222222'œœœœœœœœœœœœœœœœ \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-90 b/fuzz/dns_rdata_fromwire_text.in/input-90
new file mode 100644
index 0000000..6ae07bd
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-90
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-91 b/fuzz/dns_rdata_fromwire_text.in/input-91
new file mode 100644
index 0000000..28a0c7f
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-91
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-92 b/fuzz/dns_rdata_fromwire_text.in/input-92
new file mode 100644
index 0000000..6b7efe5
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-92
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-93 b/fuzz/dns_rdata_fromwire_text.in/input-93
new file mode 100644
index 0000000..a5395e1
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-93
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-94 b/fuzz/dns_rdata_fromwire_text.in/input-94
new file mode 100644
index 0000000..43fbdae
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-94
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-95 b/fuzz/dns_rdata_fromwire_text.in/input-95
new file mode 100644
index 0000000..742afd7
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-95
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-96 b/fuzz/dns_rdata_fromwire_text.in/input-96
new file mode 100644
index 0000000..bb8bb8a
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-96
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-97 b/fuzz/dns_rdata_fromwire_text.in/input-97
new file mode 100644
index 0000000..03d79ae
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-97
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-98 b/fuzz/dns_rdata_fromwire_text.in/input-98
new file mode 100644
index 0000000..0cc1f01
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-98
Binary files differ
diff --git a/fuzz/dns_rdata_fromwire_text.in/input-99 b/fuzz/dns_rdata_fromwire_text.in/input-99
new file mode 100644
index 0000000..1490fa0
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/input-99
@@ -0,0 +1 @@
+d"éé \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/smimea b/fuzz/dns_rdata_fromwire_text.in/smimea
new file mode 100644
index 0000000..528472d
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/smimea
@@ -0,0 +1 @@
+…-Òeœ< \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/sshfp b/fuzz/dns_rdata_fromwire_text.in/sshfp
new file mode 100644
index 0000000..b3007cd
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/sshfp
@@ -0,0 +1 @@
+|‡°|8 \ No newline at end of file
diff --git a/fuzz/dns_rdata_fromwire_text.in/svcb b/fuzz/dns_rdata_fromwire_text.in/svcb
new file mode 100644
index 0000000..800a616
--- /dev/null
+++ b/fuzz/dns_rdata_fromwire_text.in/svcb
Binary files differ
diff --git a/fuzz/fuzz.h b/fuzz/fuzz.h
new file mode 100644
index 0000000..b5645a9
--- /dev/null
+++ b/fuzz/fuzz.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <isc/lang.h>
+#include <isc/mem.h>
+#include <isc/once.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+#include <dst/dst.h>
+
+ISC_LANG_BEGINDECLS
+
+extern bool debug;
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+ISC_LANG_ENDDECLS
diff --git a/fuzz/main.c b/fuzz/main.c
new file mode 100644
index 0000000..79689d9
--- /dev/null
+++ b/fuzz/main.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "fuzz.h"
+
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+
+#include <dirent.h>
+
+bool debug = false;
+
+static void
+test_all_from(const char *dirname) {
+ DIR *dirp;
+ struct dirent *dp;
+
+ dirp = opendir(dirname);
+ if (dirp == NULL) {
+ return;
+ }
+
+ while ((dp = readdir(dirp)) != NULL) {
+ char filename[strlen(dirname) + strlen(dp->d_name) + 2];
+ int fd;
+ struct stat st;
+ char *data;
+ ssize_t n;
+
+ if (dp->d_name[0] == '.') {
+ continue;
+ }
+ snprintf(filename, sizeof(filename), "%s/%s", dirname,
+ dp->d_name);
+
+ if ((fd = open(filename, O_RDONLY)) == -1) {
+ fprintf(stderr, "Failed to open %s: %s\n", filename,
+ strerror(errno));
+ continue;
+ }
+
+ if (fstat(fd, &st) != 0) {
+ fprintf(stderr, "Failed to stat %s: %s\n", filename,
+ strerror(errno));
+ goto closefd;
+ }
+
+ data = malloc(st.st_size);
+ n = read(fd, data, st.st_size);
+ if (n == st.st_size) {
+ printf("testing %zd bytes from %s\n", n, filename);
+ fflush(stdout);
+ LLVMFuzzerTestOneInput((const uint8_t *)data, n);
+ fflush(stderr);
+ } else {
+ if (n < 0) {
+ fprintf(stderr,
+ "Failed to read %zd bytes from %s: "
+ "%s\n",
+ (ssize_t)st.st_size, filename,
+ strerror(errno));
+ } else {
+ fprintf(stderr,
+ "Failed to read %zd bytes from %s"
+ ", got %zd\n",
+ (ssize_t)st.st_size, filename, n);
+ }
+ }
+ free(data);
+ closefd:
+ close(fd);
+ }
+
+ closedir(dirp);
+}
+
+int
+main(int argc, char **argv) {
+ char corpusdir[PATH_MAX];
+ const char *target = strrchr(argv[0], '/');
+
+ UNUSED(argc);
+ UNUSED(argv);
+
+ if (argc != 1) {
+ debug = true;
+ }
+
+ target = (target != NULL) ? target + 1 : argv[0];
+ if (strncmp(target, "lt-", 3) == 0) {
+ target += 3;
+ }
+
+ snprintf(corpusdir, sizeof(corpusdir), FUZZDIR "/%s.in", target);
+
+ test_all_from(corpusdir);
+
+ return (0);
+}
+
+#elif __AFL_COMPILER
+
+int
+main(int argc, char **argv) {
+ int ret;
+ unsigned char buf[64 * 1024];
+
+ UNUSED(argc);
+ UNUSED(argv);
+
+#ifdef __AFL_LOOP
+ while (__AFL_LOOP(10000)) { /* only works with afl-clang-fast */
+#else /* ifdef __AFL_LOOP */
+ {
+#endif /* ifdef __AFL_LOOP */
+ ret = fread(buf, 1, sizeof(buf), stdin);
+ if (ret < 0) {
+ return (0);
+ }
+
+ LLVMFuzzerTestOneInput(buf, ret);
+ }
+
+ return (0);
+}
+
+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */