Skip to content

Commit f2e323e

Browse files
Dan Carpentermchehab
Dan Carpenter
authored andcommitted
[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>
1 parent 9380e11 commit f2e323e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: drivers/media/usb/ttusb-dec/ttusbdecfe.c

+3
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
156156
0x00, 0x00, 0x00, 0x00,
157157
0x00, 0x00 };
158158

159+
if (cmd->msg_len > sizeof(b) - 4)
160+
return -EINVAL;
161+
159162
memcpy(&b[4], cmd->msg, cmd->msg_len);
160163

161164
state->config->send_command(fe, 0x72,

0 commit comments

Comments
 (0)