]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] DVB: dvb_frontend: off by one in dtv_property_dump()
authorDan Carpenter <error27@gmail.com>
Thu, 26 May 2011 08:44:52 +0000 (05:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 13 Jul 2011 21:28:58 +0000 (18:28 -0300)
If the tvp->cmd == DTV_MAX_COMMAND then we read past the end of the
array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-core/dvb_frontend.c

index bed7bfe2a9d1c18dd9b65b302fc1c79f1457b1d2..c9c3c7902d4c175b6461dbd4b92be842edd1a0e2 100644 (file)
@@ -982,7 +982,7 @@ static void dtv_property_dump(struct dtv_property *tvp)
 {
        int i;
 
-       if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) {
+       if (tvp->cmd <= 0 || tvp->cmd >= DTV_MAX_COMMAND) {
                printk(KERN_WARNING "%s: tvp.cmd = 0x%08x undefined\n",
                        __func__, tvp->cmd);
                return;