summaryrefslogtreecommitdiffhomepage
path: root/dbutil.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2020-10-15 22:46:24 +0800
committerMatt Johnston <matt@ucc.asn.au>2020-10-15 22:46:24 +0800
commitcc1b07dcf170890c34c43f247334dbc78d6f8647 (patch)
tree286b81aacc40b71d53c902804e65803f556f8427 /dbutil.c
parent0e3e8db5bfca0c579be55e7580a46c593c1384be (diff)
Make wrapfd share a common buffer for all FDs
--HG-- branch : fuzz
Diffstat (limited to 'dbutil.c')
-rw-r--r--dbutil.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dbutil.c b/dbutil.c
index 32920f7..5af6330 100644
--- a/dbutil.c
+++ b/dbutil.c
@@ -121,7 +121,6 @@ static void generic_dropbear_exit(int exitcode, const char* format,
_dropbear_log(LOG_INFO, fmtbuf, param);
#if DROPBEAR_FUZZ
- /* longjmp before cleaning up svr_opts */
if (fuzz.do_jmp) {
longjmp(fuzz.jmp, 1);
}
@@ -258,6 +257,12 @@ int spawn_command(void(*exec_fn)(const void *user_data), const void *exec_data,
const int FDIN = 0;
const int FDOUT = 1;
+#if DROPBEAR_FUZZ
+ if (fuzz.fuzzing) {
+ return fuzz_spawn_command(ret_writefd, ret_readfd, ret_errfd, ret_pid);
+ }
+#endif
+
/* redirect stdin/stdout/stderr */
if (pipe(infds) != 0) {
return DROPBEAR_FAILURE;