From 49c55ed26c877a435ad081d98ba99294ac76262d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Nov 2013 18:54:22 +0100 Subject: network: Fix CID 113095 - unchecked return value from library Check return of "recv" in readline(). Found by coverity. Signed-off-by: Michael Adam --- src/network.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3