Skip to content

Commit

Permalink
Input: atkbd - fix overrun in atkbd_set_repeat_rate()
Browse files Browse the repository at this point in the history
This was introduced in commit 3d0f0fa:
bounds checking is performed against period[32] while indexing delay[4].

Spotted by Coverity, CID 1376.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Florin Malita authored and Dmitry Torokhov committed Aug 23, 2006
1 parent 2ffc1cc commit 8ea371f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 8ea371f

Please sign in to comment.