Author: csjp
Date: Fri Jun  3 14:57:38 2011
New Revision: 222654
URL: http://svn.freebsd.org/changeset/base/222654

Log:
  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

Modified:
  head/contrib/libpcap/pcap-bpf.c

Modified: head/contrib/libpcap/pcap-bpf.c
==============================================================================
--- head/contrib/libpcap/pcap-bpf.c     Fri Jun  3 14:34:38 2011        
(r222653)
+++ head/contrib/libpcap/pcap-bpf.c     Fri Jun  3 14:57:38 2011        
(r222654)
@@ -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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to