AFL fuzzing harness

This commit is contained in:
flamingcow
2019-05-04 19:00:16 -07:00
parent 9c91efb3db
commit 76271628e7
7 changed files with 70 additions and 21 deletions

View File

@@ -1,5 +1,6 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <signal.h>
#include <sys/epoll.h>
#include <sys/socket.h>
@@ -74,6 +75,9 @@ void FastCGIServer::NewConn(int listen_sock, int epoll_fd) {
PCHECK(client_sock >= 0) << "accept()";
CHECK_EQ(client_addr.sin6_family, AF_INET6);
int flags = 1;
PCHECK(setsockopt(client_sock, SOL_TCP, TCP_NODELAY, &flags, sizeof(flags)) == 0);
{
auto *conn = new FastCGIConn(client_sock, client_addr, callback_, headers_);
struct epoll_event ev{