summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-22 18:30:30 +0100
committerMichael Adam <obnox@samba.org>2013-11-22 18:49:45 +0100
commit0a998034253ccd7239777fa362a830b46b6630c6 (patch)
treeefe4e1a90d4674be79a9ebf3316373ea6ac1bd7f /src
parent9efa5799f00c55c2215c2d9af9242b91611dc718 (diff)
downloadtinyproxy-0a998034253ccd7239777fa362a830b46b6630c6.tar.gz
tinyproxy-0a998034253ccd7239777fa362a830b46b6630c6.zip
reqs: Fix CID 1130967 - unchecked return value from library.
Check the return code of fcntl via socket_blocking in pull_client_data(). Found by coverity. Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/reqs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/reqs.c b/src/reqs.c
index fcf1f09..f828065 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -534,7 +534,13 @@ static int pull_client_data (struct conn_s *connptr, long int length)
}
len = recv (connptr->client_fd, buffer, 2, MSG_PEEK);
- socket_blocking (connptr->client_fd);
+
+ ret = socket_blocking (connptr->client_fd);
+ if (ret != 0) {
+ log_message(LOG_ERR, "Failed to set the client socket "
+ "to blocking: %s", strerror(errno));
+ goto ERROR_EXIT;
+ }
if (len < 0 && errno != EAGAIN)
goto ERROR_EXIT;