]>
The Tcpdump Group git mirrors - libpcap/blob - testprogs/fuzz/fuzz_rserver.c
11 void fuzz_openFile(const char * name
) {
12 if (outfile
!= NULL
) {
15 outfile
= fopen(name
, "w");
25 void rpcapd_log(log_priority priority
, const char *message
, ...)
29 va_start(ap
, message
);
30 fprintf(outfile
, "rpcapd[%d]:", priority
);
31 vfprintf(outfile
, message
, ap
);
36 void sock_initfuzz(const uint8_t *Data
, size_t Size
);
37 int daemon_serviceloop(int sockctrl
, int isactive
, char *passiveClients
, int nullAuthAllowed
, int uses_ssl
);
39 int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
43 if (outfile
== NULL
) {
44 fuzz_openFile("/dev/null");
47 sock_initfuzz(Data
, Size
);
48 sock
= socket(AF_INET
, SOCK_STREAM
, 0);
49 if (sock
== INVALID_SOCKET
) {
52 //dummy socket, active, null auth allowed, no ssl
53 daemon_serviceloop(sock
, 1, malloc(0), 1, 0);