diff fuzz/fuzz-common.c @ 1760:2406a9987810

Add first try at fuzzing custom mutator
author Matt Johnston <matt@ucc.asn.au>
date Sun, 25 Oct 2020 22:52:36 +0800
parents 1365661f6be6
children b688c884dad7
line wrap: on
line diff
--- a/fuzz/fuzz-common.c	Sun Oct 25 21:47:42 2020 +0800
+++ b/fuzz/fuzz-common.c	Sun Oct 25 22:52:36 2020 +0800
@@ -256,10 +256,12 @@
     int fakesock = wrapfd_new();
 
     m_malloc_set_epoch(1);
+    fuzz.do_jmp = 1;
     if (setjmp(fuzz.jmp) == 0) {
         svr_session(fakesock, fakesock);
         m_malloc_free_epoch(1, 0);
     } else {
+        fuzz.do_jmp = 0;
         m_malloc_free_epoch(1, 1);
         TRACE(("dropbear_exit longjmped"))
         /* dropbear_exit jumped here */
@@ -302,10 +304,12 @@
     int fakesock = wrapfd_new();
 
     m_malloc_set_epoch(1);
+    fuzz.do_jmp = 1;
     if (setjmp(fuzz.jmp) == 0) {
         cli_session(fakesock, fakesock, NULL, 0);
         m_malloc_free_epoch(1, 0);
     } else {
+        fuzz.do_jmp = 0;
         m_malloc_free_epoch(1, 1);
         TRACE(("dropbear_exit longjmped"))
         /* dropbear_exit jumped here */