summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorSimon Rettberg2017-10-30 21:39:56 +0100
committerSimon Rettberg2017-10-30 21:39:56 +0100
commit46c3e0e276e62b6be76e69b68de56432692efcf3 (patch)
tree194ab981ea90f1227cfb94509b9d17b25bb29354 /src/shared
parent[SERVER] Missed occurence of AF_INET(6) -> HOST_IP[46] (diff)
downloaddnbd3-46c3e0e276e62b6be76e69b68de56432692efcf3.tar.gz
dnbd3-46c3e0e276e62b6be76e69b68de56432692efcf3.tar.xz
dnbd3-46c3e0e276e62b6be76e69b68de56432692efcf3.zip
[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/
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/log.c5
1 files changed, 5 insertions, 0 deletions
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
}
}