]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add __AFL_INIT() to uxplink to allow afl-fuzz to skip some startup overhead.
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 17 Oct 2015 11:25:36 +0000 (12:25 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Wed, 28 Oct 2015 22:08:58 +0000 (22:08 +0000)
unix/uxplink.c

index 836a37a6e5cccd96cbd625dd5b2e9425f7ec9d77..6d402c947385ab184e7d339526ead586e0bc9392 100644 (file)
@@ -25,7 +25,7 @@
 
 #define MAX_STDIN_BACKLOG 4096
 
-void *logctx;
+static void *logctx;
 
 static struct termios orig_termios;
 
@@ -992,6 +992,11 @@ int main(int argc, char **argv)
        /* nodelay is only useful if stdin is a terminal device */
        int nodelay = conf_get_int(conf, CONF_tcp_nodelay) && isatty(0);
 
+       /* This is a good place for a fuzzer to fork us. */
+#ifdef __AFL_HAVE_MANUAL_CONTROL
+       __AFL_INIT();
+#endif
+
        error = back->init(NULL, &backhandle, conf,
                           conf_get_str(conf, CONF_host),
                           conf_get_int(conf, CONF_port),