diff options
author | Alyssa Milburn <amilburn@zall.org> | 2017-04-01 13:33:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-25 09:44:42 -0400 |
commit | e42a6715d26bc777b545018d585333ee91cdbbe9 (patch) | |
tree | 288c2729e29117bc3ba3de1b8222fc09e12c20bd /drivers | |
parent | 28590f1bb601862c663c1e95158ffcc452593ff9 (diff) |
digitv: limit messages to buffer size
commit 821117dc21083a99dd99174c10848d70ff43de29 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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/usb/dvb-usb/digitv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/dvb-usb/digitv.c b/drivers/media/usb/dvb-usb/digitv.c index 4284f6984dc1..475a3c0cdee7 100644 --- a/drivers/media/usb/dvb-usb/digitv.c +++ b/drivers/media/usb/dvb-usb/digitv.c | |||
@@ -33,6 +33,9 @@ static int digitv_ctrl_msg(struct dvb_usb_device *d, | |||
33 | 33 | ||
34 | wo = (rbuf == NULL || rlen == 0); /* write-only */ | 34 | wo = (rbuf == NULL || rlen == 0); /* write-only */ |
35 | 35 | ||
36 | if (wlen > 4 || rlen > 4) | ||
37 | return -EIO; | ||
38 | |||
36 | memset(st->sndbuf, 0, 7); | 39 | memset(st->sndbuf, 0, 7); |
37 | memset(st->rcvbuf, 0, 7); | 40 | memset(st->rcvbuf, 0, 7); |
38 | 41 | ||