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
7int 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}
int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host)
void ares_free_hostent(struct hostent *host)
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host)
void list()
Definition userAdmin.cxx:66