diff options
author | csjp <csjp@FreeBSD.org> | 2011-06-03 14:57:38 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2011-06-03 14:57:38 +0000 |
commit | 9c392f3f9121f469140929d45260ed31420f7126 (patch) | |
tree | 31dc35a54d399ed345705d2070bff7e076c4cc76 /contrib | |
parent | ac14eff506609aa01adf3b7519861b7f6eb43c06 (diff) | |
download | FreeBSD-src-9c392f3f9121f469140929d45260ed31420f7126.zip FreeBSD-src-9c392f3f9121f469140929d45260ed31420f7126.tar.gz |
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
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libpcap/pcap-bpf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/libpcap/pcap-bpf.c b/contrib/libpcap/pcap-bpf.c index 10dcfd1..5e3d3ea 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) { |