sms-cards.c: Ensure index is positive
PATCH 1/1 sms-cards.c: Ensure index is positive
The index is signed, make sure it is not negative
when we read the array element.
Signed-off-by Roel Kluin <[email protected]>
--- drivers/media/dvb/siano/sms-cards.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/dvb/siano/sms-cards.c +1 -1
@@ -99,7 +99,7 @@ static struct sms_board sms_boards[] = {struct sms_board *sms_get_board (int id) { -BUG_ON (id >=ARRAY_SIZE (sms_boards)); +BUG_ON (id >=ARRAY_SIZE (sms_boards) || id <0 );return &sms_boards[id]; }