summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-22 18:54:22 +0100
committerMichael Adam <obnox@samba.org>2013-11-22 18:54:22 +0100
commit49c55ed26c877a435ad081d98ba99294ac76262d (patch)
treeb41073b9f298b8c30d791dbf9f2794ec6dff19f9 /src
parent198600ce42d16b1ba43605ff66585a3aa8853581 (diff)
downloadtinyproxy-49c55ed26c877a435ad081d98ba99294ac76262d.tar.gz
tinyproxy-49c55ed26c877a435ad081d98ba99294ac76262d.zip
network: Fix CID 113095 - unchecked return value from library
Check return of "recv" in readline(). Found by coverity. Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to '')
-rw-r--r--src/network.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network.c b/src/network.c
index 61dcbae..9caef04 100644
--- a/src/network.c
+++ b/src/network.c
@@ -191,7 +191,11 @@ ssize_t readline (int fd, char **whole_buffer)
goto CLEANUP;
}
- recv (fd, line_ptr->data, diff, 0);
+ ret = recv (fd, line_ptr->data, diff, 0);
+ if (ret == -1) {
+ goto CLEANUP;
+ }
+
line_ptr->len = diff;
if (ptr) {