inet_dgram_drop(): Check return value from recv()

Found by Coverity Scan.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-12-24 10:28:22 +01:00
parent 9e8a01669e
commit 3f731aa5a3
+3 -3
View File
@@ -78,11 +78,11 @@ static void inetd_dgram_drop(int sd, const char *ifname)
do {
inetd_dgram_peek(sd, pkt_interface);
if(string_compare(pkt_interface, ifname)) {
recv(sd, buf, sizeof(buf), 0);
if (string_compare(pkt_interface, ifname)) {
if (recv(sd, buf, sizeof(buf), 0) < 0)
break;
continue;
}
} while (0);
}