summaryrefslogtreecommitdiff
path: root/contrib/libpcap
diff options
context:
space:
mode:
authorChristian S.J. Peron <csjp@FreeBSD.org>2011-06-03 14:57:38 +0000
committerChristian S.J. Peron <csjp@FreeBSD.org>2011-06-03 14:57:38 +0000
commite375b204002014a4f81f15d734947277ee3e9049 (patch)
tree31dc35a54d399ed345705d2070bff7e076c4cc76 /contrib/libpcap
parenta6a3e8561d046a7e9cabc322c055903f47e5d880 (diff)
downloadsrc-test-e375b204002014a4f81f15d734947277ee3e9049.tar.gz
src-test-e375b204002014a4f81f15d734947277ee3e9049.zip
Explicitly initialize the packet buffer to NULL after we unmap the zero copy
buffers. This fixes a segfault on exit due to calling free on a bogus pointer. This should be considered a temporary stop gap fix to avoid the crash. The complete fix re-shuffles the initializations of some of the clean-up pointers. The details of the fix can be found in the libpcap git repository: commit bc8209b71e928870b0f172d43b174ab27ba24394 Proded by: kevlo, rpaulo MFC after: 2 weeks Submitted by: Anton Yuzhaninov
Notes
Notes: svn path=/head/; revision=222654
Diffstat (limited to 'contrib/libpcap')
-rw-r--r--contrib/libpcap/pcap-bpf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/libpcap/pcap-bpf.c b/contrib/libpcap/pcap-bpf.c
index 10dcfd14f58a2..5e3d3eaca2da1 100644
--- a/contrib/libpcap/pcap-bpf.c
+++ b/contrib/libpcap/pcap-bpf.c
@@ -1281,6 +1281,7 @@ pcap_cleanup_bpf(pcap_t *p)
munmap(p->md.zbuf1, p->md.zbufsize);
if (p->md.zbuf2 != MAP_FAILED && p->md.zbuf2 != NULL)
munmap(p->md.zbuf2, p->md.zbufsize);
+ p->buffer = NULL;
}
#endif
if (p->md.device != NULL) {