From: Dan Carpenter Date: Thu, 26 May 2011 08:44:52 +0000 (-0300) Subject: [media] DVB: dvb_frontend: off by one in dtv_property_dump() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bca3ba7904426bb94ee1a91e6e88831483fb5d53;p=linux-beck.git [media] DVB: dvb_frontend: off by one in dtv_property_dump() If the tvp->cmd == DTV_MAX_COMMAND then we read past the end of the array. Signed-off-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index efe9c30605e8..21c9072ed99f 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -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;