diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-21 16:50:36 +0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-31 03:43:58 +0400 |
commit | 42a8c2cbc48b9cf37fbc7ad73d0238630c5f5272 (patch) | |
tree | cf2d1a5671af7b9677c455e1677c08a804d2ef38 /drivers/media | |
parent | c360df75a2fe089ccd2bfb7b7c9729b0a377f98b (diff) | |
download | linux-42a8c2cbc48b9cf37fbc7ad73d0238630c5f5272.tar.xz |
uvcvideo: Fix ENUMINPUT handling
commit 31c5f0c5e25ed71eeced170f113bb590f2f1f6f3 upstream.
Properly validate the user-supplied index against the number of inputs.
The code used the pin local variable instead of the index by mistake.
Reported-by: Jozef Vesely <vesely@gjh.sk>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/uvc/uvc_v4l2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index cf7788f8a033..10304798d98c 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c @@ -689,7 +689,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) break; } pin = iterm->id; - } else if (pin < selector->bNrInPins) { + } else if (index < selector->bNrInPins) { pin = selector->baSourceID[index]; list_for_each_entry(iterm, &chain->entities, chain) { if (!UVC_ENTITY_IS_ITERM(iterm)) |