Skip to content

Commit

Permalink
media: ttusb-dec: buffer overflow in ioctl
Browse files Browse the repository at this point in the history
commit f2e323e 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>
  • Loading branch information
Dan Carpenter authored and gregkh committed Nov 21, 2014
1 parent 270e234 commit 0ec4fc5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/media/usb/ttusb-dec/ttusbdecfe.c
Expand Up @@ -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,
Expand Down

0 comments on commit 0ec4fc5

Please sign in to comment.