reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ares-test-fuzz.c
Go to the documentation of this file.
1
/* Code ported from c-ares test/ares-test-fuzz.c */
2
#include <stddef.h>
3
4
#include "
ares.h
"
5
6
// Entrypoint for Clang's libfuzzer
7
int
LLVMFuzzerTestOneInput
(
const
unsigned
char
*data,
8
unsigned
long
size) {
9
// Feed the data into each of the ares_parse_*_reply functions.
10
struct
hostent
*host =
NULL
;
11
ares_parse_a_reply
(data, size, &host);
12
if
(host)
ares_free_hostent
(host);
13
14
host =
NULL
;
15
unsigned
char
addrv4
[4] = {0x10, 0x20, 0x30, 0x40};
16
ares_parse_ptr_reply
(data, size,
addrv4
,
sizeof
(
addrv4
),
AF_INET
, &host);
17
if
(host)
ares_free_hostent
(host);
18
19
return
0;
20
}
LLVMFuzzerTestOneInput
int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
Definition
ares-test-fuzz.c:7
ares.h
ares_parse_a_reply
int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host)
Definition
ares_parse_a_reply.c:34
ares_free_hostent
void ares_free_hostent(struct hostent *host)
Definition
ares_free_hostent.c:24
ares_parse_ptr_reply
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host)
Definition
ares_parse_ptr_reply.c:35
list
void list()
Definition
userAdmin.cxx:66
rutil
dns
ares
ares-test-fuzz.c
Generated by
1.9.8