Mercurial > dropbear
comparison dbutil.c @ 1740:dfbe947bdf0d fuzz
Make wrapfd share a common buffer for all FDs
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 15 Oct 2020 22:46:24 +0800 |
parents | e11ed628708b |
children | a339b1c4b9f2 |
comparison
equal
deleted
inserted
replaced
1739:13d834efc376 | 1740:dfbe947bdf0d |
---|---|
119 snprintf(fmtbuf, sizeof(fmtbuf), "Exited: %s", format); | 119 snprintf(fmtbuf, sizeof(fmtbuf), "Exited: %s", format); |
120 | 120 |
121 _dropbear_log(LOG_INFO, fmtbuf, param); | 121 _dropbear_log(LOG_INFO, fmtbuf, param); |
122 | 122 |
123 #if DROPBEAR_FUZZ | 123 #if DROPBEAR_FUZZ |
124 /* longjmp before cleaning up svr_opts */ | |
125 if (fuzz.do_jmp) { | 124 if (fuzz.do_jmp) { |
126 longjmp(fuzz.jmp, 1); | 125 longjmp(fuzz.jmp, 1); |
127 } | 126 } |
128 #endif | 127 #endif |
129 | 128 |
255 int errfds[2]; | 254 int errfds[2]; |
256 pid_t pid; | 255 pid_t pid; |
257 | 256 |
258 const int FDIN = 0; | 257 const int FDIN = 0; |
259 const int FDOUT = 1; | 258 const int FDOUT = 1; |
259 | |
260 #if DROPBEAR_FUZZ | |
261 if (fuzz.fuzzing) { | |
262 return fuzz_spawn_command(ret_writefd, ret_readfd, ret_errfd, ret_pid); | |
263 } | |
264 #endif | |
260 | 265 |
261 /* redirect stdin/stdout/stderr */ | 266 /* redirect stdin/stdout/stderr */ |
262 if (pipe(infds) != 0) { | 267 if (pipe(infds) != 0) { |
263 return DROPBEAR_FAILURE; | 268 return DROPBEAR_FAILURE; |
264 } | 269 } |