]> The Tcpdump Group git mirrors - libpcap/commitdiff
Add a missing null pointer check.
authorBill Parker <[email protected]>
Mon, 13 Jul 2015 19:19:54 +0000 (12:19 -0700)
committerGuy Harris <[email protected]>
Mon, 13 Jul 2015 19:19:54 +0000 (12:19 -0700)
pcap-bpf.c

index b1da1a00325860b9555eacdfd3841911035fc44a..98140f22a03ecc8e613f54837cf4791a0133e9ba 100644 (file)
@@ -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;
        }