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>
(cherry picked from commit 49c55ed26c)
This commit is contained in:
Michael Adam 2013-11-22 18:54:22 +01:00
parent d05e801eef
commit 4ebb3c1bb6

View File

@ -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) {