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.
10
int
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
}
LLVMFuzzerTestOneInput
int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
Definition
ares-test-fuzz-name.c:10
ares.h
ares_mkquery
int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen)
Definition
ares_mkquery.c:77
ares_nameser.h
ns_c_in
@ ns_c_in
Definition
ares_nameser.h:75
ns_t_aaaa
@ ns_t_aaaa
Definition
ares_nameser.h:114
list
void list()
Definition
userAdmin.cxx:66
rutil
dns
ares
ares-test-fuzz-name.c
Generated by
1.9.8