comparison common-session.c @ 1358:6b89eb92f872 fuzz

glaring wrapfd problems fixed
author Matt Johnston <matt@ucc.asn.au>
date Sat, 20 May 2017 22:47:19 +0800
parents 08f4fa4dc6a0
children 5916af64acd4
comparison
equal deleted inserted replaced
1357:08f4fa4dc6a0 1358:6b89eb92f872
80 ses.last_packet_time_keepalive_recv = now; 80 ses.last_packet_time_keepalive_recv = now;
81 ses.last_packet_time_idle = now; 81 ses.last_packet_time_idle = now;
82 ses.last_packet_time_any_sent = 0; 82 ses.last_packet_time_any_sent = 0;
83 ses.last_packet_time_keepalive_sent = 0; 83 ses.last_packet_time_keepalive_sent = 0;
84 84
85 if (pipe(ses.signal_pipe) < 0) { 85 #ifdef DROPBEAR_FUZZ
86 dropbear_exit("Signal pipe failed"); 86 if (!fuzz.fuzzing)
87 } 87 #endif
88 setnonblocking(ses.signal_pipe[0]); 88 {
89 setnonblocking(ses.signal_pipe[1]); 89 if (pipe(ses.signal_pipe) < 0) {
90 90 dropbear_exit("Signal pipe failed");
91 ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[0]); 91 }
92 ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[1]); 92 setnonblocking(ses.signal_pipe[0]);
93 setnonblocking(ses.signal_pipe[1]);
94 ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[0]);
95 ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[1]);
96 }
93 97
94 ses.writepayload = buf_new(TRANS_MAX_PAYLOAD_LEN); 98 ses.writepayload = buf_new(TRANS_MAX_PAYLOAD_LEN);
95 ses.transseq = 0; 99 ses.transseq = 0;
96 100
97 ses.readbuf = NULL; 101 ses.readbuf = NULL;
308 remove_connect_pending(); 312 remove_connect_pending();
309 313
310 while (!isempty(&ses.writequeue)) { 314 while (!isempty(&ses.writequeue)) {
311 buf_free(dequeue(&ses.writequeue)); 315 buf_free(dequeue(&ses.writequeue));
312 } 316 }
317
318 m_free(ses.newkeys);
319 #ifndef DISABLE_ZLIB
320 if (ses.keys->recv.zstream != NULL) {
321 if (inflateEnd(ses.keys->recv.zstream) == Z_STREAM_ERROR) {
322 dropbear_exit("Crypto error");
323 }
324 m_free(ses.keys->recv.zstream);
325 }
326 #endif
313 327
314 m_free(ses.remoteident); 328 m_free(ses.remoteident);
315 m_free(ses.authstate.pw_dir); 329 m_free(ses.authstate.pw_dir);
316 m_free(ses.authstate.pw_name); 330 m_free(ses.authstate.pw_name);
317 m_free(ses.authstate.pw_shell); 331 m_free(ses.authstate.pw_shell);