[media] s5h1420: fix a buffer overflow when checking userspace params
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 28 Apr 2015 21:34:40 +0000 (18:34 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 30 Apr 2015 16:59:54 +0000 (13:59 -0300)
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up to 7 values:
drivers/media/dvb-frontends/s5h1420.c:193 s5h1420_send_master_cmd() error: buffer overflow 'cmd->msg' 6 <= 7

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/s5h1420.c

index 93eeaf7118fd0178a3dac53053f413bf4b733e3b..0b4f8fe6bf9900f8370d21bd7a12e7e336316803 100644 (file)
@@ -180,7 +180,7 @@ static int s5h1420_send_master_cmd (struct dvb_frontend* fe,
        int result = 0;
 
        dprintk("enter %s\n", __func__);
-       if (cmd->msg_len > 8)
+       if (cmd->msg_len > sizeof(cmd->msg))
                return -EINVAL;
 
        /* setup for DISEQC */