public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [media] DVB: dvb_frontend: off by one in dtv_property_dump()
@ 2011-05-26  8:44 Dan Carpenter
  2011-05-26 11:16 ` Andreas Oberritter
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2011-05-26  8:44 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Andreas Oberritter, Arnd Bergmann, Steven Toth, Lucas De Marchi,
	linux-media, kernel-janitors

If the tvp->cmd == DTV_MAX_COMMAND then we read past the end of the
array.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 9827804..607e293 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -981,7 +981,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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-04 17:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-26  8:44 [patch] [media] DVB: dvb_frontend: off by one in dtv_property_dump() Dan Carpenter
2011-05-26 11:16 ` Andreas Oberritter
2011-06-04 13:36   ` Mauro Carvalho Chehab
2011-06-04 16:52     ` walter harms

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox