From 9aad651f23c2c33c780aa7b907e3a5d1992b3c5b Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 5 Sep 2003 11:09:26 +0000 Subject: [PATCH] Fix off-by-one error in array bounds check. --- sys/dev/awi/awi_wep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/awi/awi_wep.c b/sys/dev/awi/awi_wep.c index df074f5f3e1f..c501b721d6b5 100644 --- a/sys/dev/awi/awi_wep.c +++ b/sys/dev/awi/awi_wep.c @@ -240,7 +240,7 @@ awi_wep_setalgo(sc, algo) int ctxlen; awi_crc_init(); /* XXX: not belongs here */ - if (algo < 0 || algo > sizeof(awi_wep_algo)/sizeof(awi_wep_algo[0])) + if (algo < 0 || algo >= sizeof(awi_wep_algo)/sizeof(awi_wep_algo[0])) return EINVAL; awa = &awi_wep_algo[algo]; if (awa->awa_name == NULL)