aboutsummaryrefslogtreecommitdiff
path: root/pcap-netfilter-linux.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <fx.lebail@yahoo.com>2015-01-06 20:31:20 +0100
committerFrancois-Xavier Le Bail <fx.lebail@yahoo.com>2015-01-06 20:31:20 +0100
commit7919239704a0291711ef8116d50cf166d430064d (patch)
tree04e72afea28523c6ffa2730962df20037fd733f3 /pcap-netfilter-linux.c
parent474b29947d8e710f39392c02343a3b5db86b9698 (diff)
Linux netfilter queue interface: fix a Coverity warning
The warning was: CID 1261748: Explicit null dereferenced (FORWARD_NULL) Dereferencing null pointer "nfg".
Diffstat (limited to 'pcap-netfilter-linux.c')
-rw-r--r--pcap-netfilter-linux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pcap-netfilter-linux.c b/pcap-netfilter-linux.c
index c086d949..9e61e455 100644
--- a/pcap-netfilter-linux.c
+++ b/pcap-netfilter-linux.c
@@ -196,7 +196,8 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c
/* XXX, possible responses: NF_DROP, NF_ACCEPT, NF_STOLEN, NF_QUEUE, NF_REPEAT, NF_STOP */
/* if type == NFQUEUE, handle->linktype is always != DLT_NFLOG,
so nfg is always initialized to NLMSG_DATA(nlh). */
- nfqueue_send_verdict(handle, ntohs(nfg->res_id), id, NF_ACCEPT);
+ if (nfg != NULL)
+ nfqueue_send_verdict(handle, ntohs(nfg->res_id), id, NF_ACCEPT);
}
}