Commit 8ea371fb authored by Florin Malita's avatar Florin Malita Committed by Dmitry Torokhov

Input: atkbd - fix overrun in atkbd_set_repeat_rate()

This was introduced in commit 3d0f0fa0:
bounds checking is performed against period[32] while indexing delay[4].

Spotted by Coverity, CID 1376.
Signed-off-by: default avatarFlorin Malita <fmalita@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 2ffc1cca
...@@ -498,7 +498,7 @@ static int atkbd_set_repeat_rate(struct atkbd *atkbd) ...@@ -498,7 +498,7 @@ static int atkbd_set_repeat_rate(struct atkbd *atkbd)
i++; i++;
dev->rep[REP_PERIOD] = period[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++; j++;
dev->rep[REP_DELAY] = delay[j]; dev->rep[REP_DELAY] = delay[j];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment