Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2016 08:04:57 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r299615 - stable/10/sys/net
Message-ID:  <201605130804.u4D84vW1055475@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri May 13 08:04:57 2016
New Revision: 299615
URL: https://svnweb.freebsd.org/changeset/base/299615

Log:
  MFC r298328:
  r298328 (by cem):
  
  bpf_getdltlist: Don't overrun 'lst'
  
  'lst' is allocated with 'n1' members.  'n' indexes 'lst'.  So 'n == n1' is an
  invalid 'lst' index.  This is a follow-up to r296009.
  
  CID:		1352743

Modified:
  stable/10/sys/net/bpf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/bpf.c
==============================================================================
--- stable/10/sys/net/bpf.c	Fri May 13 08:04:03 2016	(r299614)
+++ stable/10/sys/net/bpf.c	Fri May 13 08:04:57 2016	(r299615)
@@ -2643,7 +2643,7 @@ again:
 	LIST_FOREACH(bp, &bpf_iflist, bif_next) {
 		if (bp->bif_ifp != ifp)
 			continue;
-		if (n > n1) {
+		if (n >= n1) {
 			free(lst, M_TEMP);
 			goto again;
 		}



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