Bug#72 reading zero bytes in linux BIP. Thanks, Mikhail! (#132)

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2020-10-10 10:45:12 -05:00
committed by GitHub
parent b6697c6f54
commit 762ffacc8e
+4
View File
@@ -516,6 +516,10 @@ static int readNlSock(
perror("SOCK READ: "); perror("SOCK READ: ");
return -1; return -1;
} }
if (readLen == 0) {
/* no data in the response */
break;
}
nlHdr = (struct nlmsghdr *)bufPtr; nlHdr = (struct nlmsghdr *)bufPtr;
/* Check if the header is valid */ /* Check if the header is valid */
if ((0 == NLMSG_OK(nlHdr, readLen)) || if ((0 == NLMSG_OK(nlHdr, readLen)) ||