mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
digitv: limit messages to buffer size
commit 821117dc21 upstream.
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
28590f1bb6
commit
e42a6715d2
@@ -33,6 +33,9 @@ static int digitv_ctrl_msg(struct dvb_usb_device *d,
|
||||
|
||||
wo = (rbuf == NULL || rlen == 0); /* write-only */
|
||||
|
||||
if (wlen > 4 || rlen > 4)
|
||||
return -EIO;
|
||||
|
||||
memset(st->sndbuf, 0, 7);
|
||||
memset(st->rcvbuf, 0, 7);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user