mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
fuzz: fix crash in newtcpdirect(), don't close the channel too early
This commit is contained in:
13
netio.c
13
netio.c
@@ -179,12 +179,6 @@ struct dropbear_progress_connection *connect_remote(const char* remotehost, cons
|
||||
int err;
|
||||
struct addrinfo hints;
|
||||
|
||||
#if DROPBEAR_FUZZ
|
||||
if (fuzz.fuzzing) {
|
||||
return fuzz_connect_remote(remotehost, remoteport, cb, cb_data, bind_address, bind_port);
|
||||
}
|
||||
#endif
|
||||
|
||||
c = m_malloc(sizeof(*c));
|
||||
c->remotehost = m_strdup(remotehost);
|
||||
c->remoteport = m_strdup(remoteport);
|
||||
@@ -194,6 +188,13 @@ struct dropbear_progress_connection *connect_remote(const char* remotehost, cons
|
||||
|
||||
list_append(&ses.conn_pending, c);
|
||||
|
||||
#if DROPBEAR_FUZZ
|
||||
if (fuzz.fuzzing) {
|
||||
c->errstring = m_strdup("fuzzing connect_remote always fails");
|
||||
return c;
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
||||
Reference in New Issue
Block a user