svn commit: r327229 - stable/11/contrib/tcpdump

Ed Maste emaste at FreeBSD.org
Wed Dec 27 03:18:14 UTC 2017


Author: emaste
Date: Wed Dec 27 03:18:13 2017
New Revision: 327229
URL: https://svnweb.freebsd.org/changeset/base/327229

Log:
  MFC r317409 by glebius:
  
  Cherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free
  if tcpdump(1) is run on non-existent interface.

Modified:
  stable/11/contrib/tcpdump/tcpdump.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/tcpdump/tcpdump.c
==============================================================================
--- stable/11/contrib/tcpdump/tcpdump.c	Wed Dec 27 00:34:13 2017	(r327228)
+++ stable/11/contrib/tcpdump/tcpdump.c	Wed Dec 27 03:18:13 2017	(r327229)
@@ -1085,9 +1085,9 @@ open_interface(const char *device, netdissect_options 
 			/*
 			 * Return an error for our caller to handle.
 			 */
-			pcap_close(pc);
 			snprintf(ebuf, PCAP_ERRBUF_SIZE, "%s: %s\n(%s)",
 			    device, pcap_statustostr(status), cp);
+			pcap_close(pc);
 			return (NULL);
 		} else if (status == PCAP_ERROR_PERM_DENIED && *cp != '\0')
 			error("%s: %s\n(%s)", device,


More information about the svn-src-all mailing list