summaryrefslogtreecommitdiff
path: root/fuzz.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2020-10-26 23:44:43 +0800
committerMatt Johnston <matt@ucc.asn.au>2020-10-26 23:44:43 +0800
commit8ae0626717e8a5514d9b52d714c3a6a229e0407d (patch)
tree4cb1002a3e2c43b3dde80b978db3eeb09b3fe466 /fuzz.h
parente7a41dc69848e22e1e95173a085dbea8b7175c89 (diff)
downloaddropbear-8ae0626717e8a5514d9b52d714c3a6a229e0407d.tar.gz
Fix fuzzing stderr override on os x
Diffstat (limited to 'fuzz.h')
-rw-r--r--fuzz.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/fuzz.h b/fuzz.h
index f25a835..ae781df 100644
--- a/fuzz.h
+++ b/fuzz.h
@@ -74,18 +74,24 @@ struct dropbear_fuzz_options {
int recv_dumpfd;
// avoid filling fuzzing logs, this points to /dev/null
- FILE *stderr;
+ FILE *fake_stderr;
};
extern struct dropbear_fuzz_options fuzz;
+/* guard for when fuzz.h is included by fuzz-common.c */
+#ifndef FUZZ_NO_REPLACE_STDERR
+
/* This is a bodge but seems to work.
glibc stdio.h has the comment
"C89/C99 say they're macros. Make them happy." */
+/* OS X has it as a macro */
#ifdef stderr
#undef stderr
#endif
-#define stderr (fuzz.stderr)
+#define stderr (fuzz.fake_stderr)
+
+#endif /* FUZZ_NO_REPLACE_STDERR */
#endif // DROPBEAR_FUZZ