Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jan 2010 05:22:28 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r202550 - stable/7/usr.sbin/rtsold
Message-ID:  <201001180522.o0I5MS2O060494@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Jan 18 05:22:27 2010
New Revision: 202550
URL: http://svn.freebsd.org/changeset/base/202550

Log:
  MFC r201520:
  
  Test index value is within the range before using it to reference
  array member.
  
  PR:		bin/141838
  Submitted by:	Henning Petersen <henning.petersen@t-online.de>

Modified:
  stable/7/usr.sbin/rtsold/probe.c
Directory Properties:
  stable/7/usr.sbin/rtsold/   (props changed)

Modified: stable/7/usr.sbin/rtsold/probe.c
==============================================================================
--- stable/7/usr.sbin/rtsold/probe.c	Mon Jan 18 05:03:40 2010	(r202549)
+++ stable/7/usr.sbin/rtsold/probe.c	Mon Jan 18 05:22:27 2010	(r202550)
@@ -118,7 +118,7 @@ defrouter_probe(struct ifinfo *ifinfo)
 		goto closeandend;
 	}
 
-	for (i = 0; dr.defrouter[i].if_index && i < PRLSTSIZ; i++) {
+	for (i = 0; i < DRLSTSIZ && dr.defrouter[i].if_index; i++) {
 		if (ifindex && dr.defrouter[i].if_index == ifindex) {
 			/* sanity check */
 			if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) {



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