diff options
Diffstat (limited to 'common-session.c')
-rw-r--r-- | common-session.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/common-session.c b/common-session.c index 99a5470..aa0dddb 100644 --- a/common-session.c +++ b/common-session.c @@ -82,14 +82,18 @@ void common_session_init(int sock_in, int sock_out) { ses.last_packet_time_any_sent = 0; ses.last_packet_time_keepalive_sent = 0; - if (pipe(ses.signal_pipe) < 0) { - dropbear_exit("Signal pipe failed"); +#ifdef DROPBEAR_FUZZ + if (!fuzz.fuzzing) +#endif + { + if (pipe(ses.signal_pipe) < 0) { + dropbear_exit("Signal pipe failed"); + } + setnonblocking(ses.signal_pipe[0]); + setnonblocking(ses.signal_pipe[1]); + ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[0]); + ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[1]); } - setnonblocking(ses.signal_pipe[0]); - setnonblocking(ses.signal_pipe[1]); - - ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[0]); - ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[1]); ses.writepayload = buf_new(TRANS_MAX_PAYLOAD_LEN); ses.transseq = 0; @@ -161,7 +165,12 @@ void session_loop(void(*loophandler)()) { /* We get woken up when signal handlers write to this pipe. SIGCHLD in svr-chansession is the only one currently. */ - FD_SET(ses.signal_pipe[0], &readfd); +#ifdef DROPBEAR_FUZZ + if (!fuzz.fuzzing) +#endif + { + FD_SET(ses.signal_pipe[0], &readfd); + } ses.channel_signal_pending = 0; /* set up for channels which can be read/written */ @@ -306,6 +315,16 @@ void session_cleanup() { buf_free(dequeue(&ses.writequeue)); } + m_free(ses.newkeys); +#ifndef DISABLE_ZLIB + if (ses.keys->recv.zstream != NULL) { + if (inflateEnd(ses.keys->recv.zstream) == Z_STREAM_ERROR) { + dropbear_exit("Crypto error"); + } + m_free(ses.keys->recv.zstream); + } +#endif + m_free(ses.remoteident); m_free(ses.authstate.pw_dir); m_free(ses.authstate.pw_name); |