Skip to content

Commit

Permalink
media: dvb_ca_en50221: off by one in dvb_ca_en50221_io_do_ioctl()
Browse files Browse the repository at this point in the history
The > should be >= so we don't read one element beyond the end of the
ca->slot_info[] array.  The array is allocated in dvb_ca_en50221_init().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jasmin Jessich <jasmin@anw.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Aug 2, 2018
1 parent 320905b commit 6706fe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb-core/dvb_ca_en50221.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
struct dvb_ca_slot *sl;

slot = info->num;
if ((slot > ca->slot_count) || (slot < 0)) {
if ((slot >= ca->slot_count) || (slot < 0)) {
err = -EINVAL;
goto out_unlock;
}
Expand Down

0 comments on commit 6706fe5

Please sign in to comment.