aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-08 19:39:21 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-09 11:09:34 +0200
commit9abe591843b92cc73b8015cc910a058445e4139c (patch)
tree6de5ef9e078054ae1afc3ca131b823efe78f7294
parent114cc51a10adaca767c8e327b97e8707f04e1574 (diff)
downloadlibssh-9abe591843b92cc73b8015cc910a058445e4139c.tar.gz
libssh-9abe591843b92cc73b8015cc910a058445e4139c.tar.xz
libssh-9abe591843b92cc73b8015cc910a058445e4139c.zip
client: Check return value of ssh_handle_packets_termination.
Found by Coverity.
-rw-r--r--src/client.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/client.c b/src/client.c
index eaef21c7..331d3c21 100644
--- a/src/client.c
+++ b/src/client.c
@@ -535,18 +535,21 @@ pending:
timeout = 10 * 1000;
}
ssh_log(session,SSH_LOG_PACKET,"ssh_connect: Actual timeout : %d", timeout);
- ssh_handle_packets_termination(session, timeout, ssh_connect_termination, session);
- if(!ssh_connect_termination(session)){
+ ret = ssh_handle_packets_termination(session, timeout, ssh_connect_termination, session);
+ if (ret == SSH_ERROR || !ssh_connect_termination(session)) {
ssh_set_error(session, SSH_FATAL,
"Timeout connecting to %s", session->opts.host);
session->session_state = SSH_SESSION_STATE_ERROR;
}
}
else {
- ssh_handle_packets_termination(session,
- SSH_TIMEOUT_NONBLOCKING,
- ssh_connect_termination,
- session);
+ ret = ssh_handle_packets_termination(session,
+ SSH_TIMEOUT_NONBLOCKING,
+ ssh_connect_termination,
+ session);
+ if (ret == SSH_ERROR) {
+ session->session_state = SSH_SESSION_STATE_ERROR;
+ }
}
ssh_log(session,SSH_LOG_PACKET,"ssh_connect: Actual state : %d",session->session_state);
if(!ssh_is_blocking(session) && !ssh_connect_termination(session)){