]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
uvcvideo: Fix ENUMINPUT handling
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 21 Mar 2012 12:50:36 +0000 (09:50 -0300)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 May 2012 23:43:58 +0000 (00:43 +0100)
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>
drivers/media/video/uvc/uvc_v4l2.c

index cf7788f8a0333fcd5b2d02c95c6415821b9c19dc..10304798d98c6e558b22456089efd0d5700fad93 100644 (file)
@@ -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))