summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-22 17:28:33 +0100
committerMichael Adam <obnox@samba.org>2013-11-22 17:35:54 +0100
commit2004abc1e33f5c59365f7494f3a288b4dc8beb62 (patch)
tree937409350694e843856f14e56bb82c00b004c216
parenta244c1d4aae776d98a769fcf51b2d8bbca502ca4 (diff)
reqs: fix CID 1130970 - 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 client fd. Found by coverity. Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r--src/reqs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/reqs.c b/src/reqs.c
index d7f5438..00e20aa 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -1119,7 +1119,13 @@ static void relay_connection (struct conn_s *connptr)
int maxfd = max (connptr->client_fd, connptr->server_fd) + 1;
ssize_t bytes_received;
- socket_nonblocking (connptr->client_fd);
+ ret = socket_nonblocking (connptr->client_fd);
+ if (ret != 0) {
+ log_message(LOG_ERR, "Failed to set the client socket "
+ "to non-blocking: %s", strerror(errno));
+ return;
+ }
+
socket_nonblocking (connptr->server_fd);
last_access = time (NULL);