From be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 04:57:58 +0200 Subject: Adding upstream version 1.44.3. Signed-off-by: Daniel Baumann --- .../lib/c-ares-1.19.1/test/ares-test-fuzz-name.c | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 fluent-bit/lib/c-ares-1.19.1/test/ares-test-fuzz-name.c (limited to 'fluent-bit/lib/c-ares-1.19.1/test/ares-test-fuzz-name.c') diff --git a/fluent-bit/lib/c-ares-1.19.1/test/ares-test-fuzz-name.c b/fluent-bit/lib/c-ares-1.19.1/test/ares-test-fuzz-name.c new file mode 100644 index 00000000..82df7437 --- /dev/null +++ b/fluent-bit/lib/c-ares-1.19.1/test/ares-test-fuzz-name.c @@ -0,0 +1,23 @@ +#include +#include +#include + +#include "ares.h" +// Include ares internal file for DNS protocol constants +#include "ares_nameser.h" + +// Entrypoint for Clang's libfuzzer, exercising query creation. +int LLVMFuzzerTestOneInput(const unsigned char *data, + unsigned long size) { + // Null terminate the data. + char *name = malloc(size + 1); + name[size] = '\0'; + memcpy(name, data, size); + + unsigned char *buf = NULL; + int buflen = 0; + ares_create_query(name, C_IN, T_AAAA, 1234, 0, &buf, &buflen, 1024); + free(buf); + free(name); + return 0; +} -- cgit v1.2.3