Skip to content

Commit eb6de67

Browse files
committed
apply __AFL_LOOP() macro / persistent fuzzing
1 parent 71f9190 commit eb6de67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fuzz.patch.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ static void fuzzer_thread(void)
6565
int BUFSIZE=1024*1024;
6666
usleep(10000);
6767
char buf[BUFSIZE+1];
68+
while ( __AFL_LOOP(10000)) {
69+
printf("[+] Looping\n");
6870
memset(buf, 0, BUFSIZE);
6971
size_t read_bytes = read(0, buf, BUFSIZE);
7072
buf[BUFSIZE-2] = '\r';
@@ -110,8 +112,8 @@ static void fuzzer_thread(void)
110112
while (recv(sockfd, b, sizeof(b), MSG_WAITALL) > 0) ;
111113

112114
printf("[+] Received %s\n", b);
113-
114115
close(sockfd);
116+
}
115117
printf("[+] Done\n");
116118
usleep(100000);
117119
exit(0);

0 commit comments

Comments
 (0)