Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] digitv: limit messages to buffer size

Return an error rather than memcpy()ing beyond the end of the buffer.
Internal callers use appropriate sizes, but digitv_i2c_xfer may not.

Signed-off-by: Alyssa Milburn <amilburn@zall.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Alyssa Milburn and committed by
Mauro Carvalho Chehab
821117dc e8357cde

+3
+3
drivers/media/usb/dvb-usb/digitv.c
··· 33 33 34 34 wo = (rbuf == NULL || rlen == 0); /* write-only */ 35 35 36 + if (wlen > 4 || rlen > 4) 37 + return -EIO; 38 + 36 39 memset(st->sndbuf, 0, 7); 37 40 memset(st->rcvbuf, 0, 7); 38 41