diff options
author | Michael Adam <obnox@samba.org> | 2013-11-22 17:34:20 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-11-22 17:35:59 +0100 |
commit | 68bd0b61b56c5bbf8c2687c3d46edc35f64679af (patch) | |
tree | 498e7e65b2a8b654ede9fe85a3c081ba5e7e103b /src | |
parent | 2004abc1e33f5c59365f7494f3a288b4dc8beb62 (diff) | |
download | tinyproxy-68bd0b61b56c5bbf8c2687c3d46edc35f64679af.tar.gz tinyproxy-68bd0b61b56c5bbf8c2687c3d46edc35f64679af.zip |
reqs: fix CID 1130969 - unchecked return code from library
Effectively, the return code of fcntl was not checked
by not checking the return code of socket_nonblocking()
for the server fd.
Found by coverity.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/reqs.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1126,7 +1126,12 @@ static void relay_connection (struct conn_s *connptr) return; } - socket_nonblocking (connptr->server_fd); + ret = socket_nonblocking (connptr->server_fd); + if (ret != 0) { + log_message(LOG_ERR, "Failed to set the server socket " + "to non-blocking: %s", strerror(errno)); + return; + } last_access = time (NULL); |