Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jun 2011 14:57:38 +0000 (UTC)
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222654 - head/contrib/libpcap
Message-ID:  <201106031457.p53Evc7P068629@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106031457.p53Evc7P068629>