Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31c5f0c5 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

[media] uvcvideo: Fix ENUMINPUT handling



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: default avatarJozef Vesely <vesely@gjh.sk>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent aeebb1b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -694,7 +694,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))