From: Florin Malita Date: Wed, 23 Aug 2006 04:45:33 +0000 (-0400) Subject: Input: atkbd - fix overrun in atkbd_set_repeat_rate() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8ea371fb6df5a6e8056265e0089fd578e87797fc;p=openwrt%2Fstaging%2Fblogic.git Input: atkbd - fix overrun in atkbd_set_repeat_rate() This was introduced in commit 3d0f0fa0cb554541e10cb8cb84104e4b10828468: bounds checking is performed against period[32] while indexing delay[4]. Spotted by Coverity, CID 1376. Signed-off-by: Florin Malita Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 6bfa0cf4b1d2..a86afd0a5ef1 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -498,7 +498,7 @@ static int atkbd_set_repeat_rate(struct atkbd *atkbd) i++; dev->rep[REP_PERIOD] = period[i]; - while (j < ARRAY_SIZE(period) - 1 && delay[j] < dev->rep[REP_DELAY]) + while (j < ARRAY_SIZE(delay) - 1 && delay[j] < dev->rep[REP_DELAY]) j++; dev->rep[REP_DELAY] = delay[j];