summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-09-05 09:09:28 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-21 09:22:54 -0800
commit0ec4fc584c3ee470f5150450acf49dd2dab5d1e7 (patch)
treef81651850202e0ab96e9978f954131b3bbc0ff1b
parent270e234c60d21681ac2afc04329cc0b5ab4ff035 (diff)
downloadlwn-0ec4fc584c3ee470f5150450acf49dd2dab5d1e7.tar.gz
lwn-0ec4fc584c3ee470f5150450acf49dd2dab5d1e7.zip
media: ttusb-dec: buffer overflow in ioctl
commit f2e323ec96077642d397bb1c355def536d489d16 upstream. We need to add a limit check here so we don't overflow the buffer. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/usb/ttusb-dec/ttusbdecfe.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 5c45c9d0712d..9c29552aedec 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -156,6 +156,9 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
0x00, 0x00, 0x00, 0x00,
0x00, 0x00 };
+ if (cmd->msg_len > sizeof(b) - 4)
+ return -EINVAL;
+
memcpy(&b[4], cmd->msg, cmd->msg_len);
state->config->send_command(fe, 0x72,