media: dvb_ca_en50221: off by one in dvb_ca_en50221_io_do_ioctl()
Commit Message
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>
Comments
Hello Dan!
I checked this and this is in since ages. Good catch!
I did a quick look to the other places where this is checked also
and they seem all ok.
Acked-by: Jasmin Jessich <jasmin@anw.at>
BR,
Jasmin
@@ -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;
}