Commit 233548a2 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

V4L/DVB (8207): uvcvideo: Fix a buffer overflow in format descriptor parsing

Thanks to Oliver Neukum for catching and reporting this bug.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 553b9fa4
...@@ -298,7 +298,8 @@ static int uvc_parse_format(struct uvc_device *dev, ...@@ -298,7 +298,8 @@ static int uvc_parse_format(struct uvc_device *dev,
switch (buffer[2]) { switch (buffer[2]) {
case VS_FORMAT_UNCOMPRESSED: case VS_FORMAT_UNCOMPRESSED:
case VS_FORMAT_FRAME_BASED: case VS_FORMAT_FRAME_BASED:
if (buflen < 27) { n = buffer[2] == VS_FORMAT_UNCOMPRESSED ? 27 : 28;
if (buflen < n) {
uvc_trace(UVC_TRACE_DESCR, "device %d videostreaming" uvc_trace(UVC_TRACE_DESCR, "device %d videostreaming"
"interface %d FORMAT error\n", "interface %d FORMAT error\n",
dev->udev->devnum, dev->udev->devnum,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment