From c6d99bd3a4ee587a37a5f402b3f6091545a16ebc Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Fri, 26 Dec 2014 13:45:59 +0100 Subject: [PATCH] session.c: check return value of session_nonblock during startup Reported by Coverity CID 89803. --- src/session.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/session.c b/src/session.c index dc9dcd4..c253c66 100644 --- a/src/session.c +++ b/src/session.c @@ -687,7 +687,12 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock) if (session->socket_prev_blockstate) { /* If in blocking state change to non-blocking */ - session_nonblock(session->socket_fd, 1); + rc = session_nonblock(session->socket_fd, 1); + if (rc) { + return _libssh2_error(session, rc, + "Failed changing socket's " + "blocking state to non-blocking"); + } } session->startup_state = libssh2_NB_state_created;