From 000ae818d4e97b14fbf7fd83433db6df1de48e31 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 21 Oct 2021 17:36:05 +0200 Subject: [PATCH] pcap: Fix failure check on write() in pcapm() Signed-off-by: Stefano Brivio --- pcap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcap.c b/pcap.c index 7b5a1af..0c61cd8 100644 --- a/pcap.c +++ b/pcap.c @@ -118,7 +118,8 @@ void pcapm(struct msghdr *mh) if (write(pcap_fd, &h, sizeof(h)) < 0) goto fail; - if (write(pcap_fd, (char *)iov->iov_base + 4, iov->iov_len - 4)) + if (write(pcap_fd, (char *)iov->iov_base + 4, + iov->iov_len - 4) < 0) goto fail; }