From 46c3e0e276e62b6be76e69b68de56432692efcf3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 30 Oct 2017 21:39:56 +0100 Subject: [SERVER] Add AFL support AFL is an instrumenting fuzzer. It expects to pass input to the program to be tested via command line (file name) or via stdin. This adds support for reading messages that normally would arrive via network directly from stdin. In this mode, the server is pretty useless otherwise. http://lcamtuf.coredump.cx/afl/ --- src/shared/log.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/shared') diff --git a/src/shared/log.c b/src/shared/log.c index 1022cec..62b104e 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -114,8 +114,13 @@ void logadd(const logmask_t mask, const char *fmt, ...) pthread_mutex_unlock( &logLock ); } if ( maskCon & mask ) { +#ifdef AFL_MODE + fputs( buffer, stderr ); + fflush( stderr ); +#else fputs( buffer, stdout ); fflush( stdout ); +#endif } } -- cgit v1.2.3-55-g7522