aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-09-05 08:09:28 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-23 15:13:37 -0400
commitf2e323ec96077642d397bb1c355def536d489d16 (patch)
tree3d8d24ee7d8deb8eb9befe8b3264b1f9b0f5017e
parent9380e112f7b9ab83b57062f2164476e76c5533c7 (diff)
[media] ttusb-dec: buffer overflow in ioctl
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>
-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
156 0x00, 0x00, 0x00, 0x00, 156 0x00, 0x00, 0x00, 0x00,
157 0x00, 0x00 }; 157 0x00, 0x00 };
158 158
159 if (cmd->msg_len > sizeof(b) - 4)
160 return -EINVAL;
161
159 memcpy(&b[4], cmd->msg, cmd->msg_len); 162 memcpy(&b[4], cmd->msg, cmd->msg_len);
160 163
161 state->config->send_command(fe, 0x72, 164 state->config->send_command(fe, 0x72,