diff options
author | Michael Adam <obnox@samba.org> | 2013-11-22 18:54:22 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-11-22 18:54:22 +0100 |
commit | 49c55ed26c877a435ad081d98ba99294ac76262d (patch) | |
tree | b41073b9f298b8c30d791dbf9f2794ec6dff19f9 /src | |
parent | 198600ce42d16b1ba43605ff66585a3aa8853581 (diff) | |
download | tinyproxy-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.c | 6 |
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) { |