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>
This commit is contained in:
delphij 2010-01-18 04:58:14 +00:00
parent 258a09a63f
commit 7dac57c0ec

View File

@ -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)) {