summaryrefslogtreecommitdiff
path: root/lib/libpcap/pcap-bpf.c
diff options
context:
space:
mode:
authorLawrence Teo <lteo@cvs.openbsd.org>2015-01-16 03:04:20 +0000
committerLawrence Teo <lteo@cvs.openbsd.org>2015-01-16 03:04:20 +0000
commit193a4793a5e25289b05157edb758e99afae65978 (patch)
treea20d93b541a11a47d382243aa0c5257d3ae6948a /lib/libpcap/pcap-bpf.c
parentb81f1c93e0a291ee9daddcda9045fad31b7ac885 (diff)
Fix a use after free, where the already freed p->opt.source was used by
pcap_cleanup_bpf() to disable monitor mode on 802.11 devices. feedback blambert@ ok deraadt@ mikeb@ millert@
Diffstat (limited to 'lib/libpcap/pcap-bpf.c')
-rw-r--r--lib/libpcap/pcap-bpf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libpcap/pcap-bpf.c b/lib/libpcap/pcap-bpf.c
index 12a7130e3aa..5ca44688c13 100644
--- a/lib/libpcap/pcap-bpf.c
+++ b/lib/libpcap/pcap-bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcap-bpf.c,v 1.24 2014/10/16 20:08:21 deraadt Exp $ */
+/* $OpenBSD: pcap-bpf.c,v 1.25 2015/01/16 03:04:19 lteo Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1998
@@ -431,9 +431,8 @@ pcap_cleanup_bpf(pcap_t *p)
void
pcap_close(pcap_t *p)
{
- if (p->opt.source != NULL)
- free(p->opt.source);
pcap_cleanup_bpf(p);
+ free(p->opt.source);
free(p);
}