summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-22 21:44:12 +0100
committerMichael Adam <obnox@samba.org>2013-11-22 21:44:12 +0100
commite07c363df24f5631477f895713728c31ddfd3d43 (patch)
tree550b8d8f71d48b06b5f19afc4048f61151c42932
parentc82840bfcb8d48f2af1b7c00ab0e4cd6b8886302 (diff)
downloadtinyproxy-e07c363df24f5631477f895713728c31ddfd3d43.tar.gz
tinyproxy-e07c363df24f5631477f895713728c31ddfd3d43.zip
reqs: Fix CID 1130969 (part 2) - unchecked return value from library.
Check the return value of socket_blocking (fcntl) at the end of relay_connection(). Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to '')
-rw-r--r--src/reqs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/reqs.c b/src/reqs.c
index a140f5c..439d0e1 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -1220,7 +1220,14 @@ static void relay_connection (struct conn_s *connptr)
/*
* Try to send any remaining data to the server if we can.
*/
- socket_blocking (connptr->server_fd);
+ ret = socket_blocking (connptr->server_fd);
+ if (ret != 0) {
+ log_message(LOG_ERR,
+ "Failed to set server socket to blocking: %s",
+ strerror(errno));
+ return;
+ }
+
while (buffer_size (connptr->cbuffer) > 0) {
if (write_buffer (connptr->server_fd, connptr->cbuffer) < 0)
break;