From f662719dc20132ce7579d13e09ec7d2fb5f5c18b Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 3 Mar 2021 23:58:28 +0000 Subject: [PATCH] off by one ok claudio@ deraadt@ --- sys/dev/ic/pgt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index 6847e5c3be9..a75179f375a 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgt.c,v 1.99 2020/07/10 13:26:37 patrick Exp $ */ +/* $OpenBSD: pgt.c,v 1.100 2021/03/03 23:58:28 jsg Exp $ */ /* * Copyright (c) 2006 Claudio Jeker @@ -2398,7 +2398,7 @@ pgt_obj_bss2scanres(struct pgt_softc *sc, struct pgt_obj_bss *pob, n = 0; for (i = 0; i < 16; i++) { if (letoh16(pob->pob_rates) & (1 << i)) { - if (i > rs->rs_nrates) + if (i >= rs->rs_nrates) break; ap.wi_srates[n++] = ap.wi_rate = rs->rs_rates[i]; if (n >= sizeof(ap.wi_srates) / sizeof(ap.wi_srates[0])) -- 2.20.1