Commit 1a4b6a9a authored by Alyssa Milburn's avatar Alyssa Milburn Committed by Ben Hutchings

digitv: limit messages to buffer size

commit 821117dc 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: default avatarAlyssa Milburn <amilburn@zall.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent b0531078
......@@ -30,6 +30,10 @@ static int digitv_ctrl_msg(struct dvb_usb_device *d,
{
int wo = (rbuf == NULL || rlen == 0); /* write-only */
u8 sndbuf[7],rcvbuf[7];
if (wlen > 4 || rlen > 4)
return -EIO;
memset(sndbuf,0,7); memset(rcvbuf,0,7);
sndbuf[0] = cmd;
......
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