mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 14:40:12 -04:00
V4L/DVB: video/au0828: off by one bug
The "AUVI_INPUT(tmp)" macro uses "tmp" as an index of an array with AU0828_MAX_INPUT elements. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
6e1f4df7da
commit
f5e20c34e9
@@ -1105,7 +1105,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
|
||||
|
||||
tmp = input->index;
|
||||
|
||||
if (tmp > AU0828_MAX_INPUT)
|
||||
if (tmp >= AU0828_MAX_INPUT)
|
||||
return -EINVAL;
|
||||
if (AUVI_INPUT(tmp).type == 0)
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user