summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtsold
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2010-01-18 04:58:14 +0000
committerdelphij <delphij@FreeBSD.org>2010-01-18 04:58:14 +0000
commit7dac57c0ec71d902040c050389e26e9d0d7f7421 (patch)
treec50b89a7f02843b8f401652f09d7f05cb0c0ccbf /usr.sbin/rtsold
parent258a09a63f93b76b1ccd2c3d907309d3556f50b7 (diff)
downloadFreeBSD-src-7dac57c0ec71d902040c050389e26e9d0d7f7421.zip
FreeBSD-src-7dac57c0ec71d902040c050389e26e9d0d7f7421.tar.gz
MFC r210520:
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>
Diffstat (limited to 'usr.sbin/rtsold')
-rw-r--r--usr.sbin/rtsold/probe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c
index 61c47bc..6d0ea79 100644
--- a/usr.sbin/rtsold/probe.c
+++ b/usr.sbin/rtsold/probe.c
@@ -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)) {
OpenPOWER on IntegriCloud