From: Bill Parker Date: Mon, 13 Jul 2015 19:19:54 +0000 (-0700) Subject: Add a missing null pointer check. X-Git-Tag: libpcap-1.8.0-bp~274 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/20d58b986420e7c9bc72b3c32568f4f5aacbd163 Add a missing null pointer check. --- diff --git a/pcap-bpf.c b/pcap-bpf.c index b1da1a00..98140f22 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -1575,6 +1575,12 @@ pcap_activate_bpf(pcap_t *p) goto bad; } lnamep = strdup(zonesep + 1); + if (lnamep == NULL) { + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "strdup: %s", + pcap_strerror(errno)); + status = PCAP_ERROR; + goto bad; + } free(p->opt.source); p->opt.source = lnamep; }