reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ares-test-fuzz-name.c
Go to the documentation of this file.
1/* Code ported from c-ares test/ares-test-fuzz-name.c */
2#include <stddef.h>
3#include <stdlib.h>
4#include <string.h>
5
6#include "ares.h"
7#include "ares_nameser.h"
8
9// Entrypoint for Clang's libfuzzer, exercising query creation.
10int LLVMFuzzerTestOneInput(const unsigned char *data,
11 unsigned long size) {
12 // Null terminate the data.
13 char *name = malloc(size + 1);
14 name[size] = '\0';
15 memcpy(name, data, size);
16
17 unsigned char *buf = NULL;
18 int buflen = 0;
19 ares_mkquery(name, ns_c_in, ns_t_aaaa, 1234, 0, &buf, &buflen);
20 free(buf);
21 free(name);
22 return 0;
23}
int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen)
@ ns_c_in
@ ns_t_aaaa
void list()
Definition userAdmin.cxx:66