From: Roel Kluin <roel.kluin@gmail.com>
To: mchehab@redhat.com, linux-media@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] tuner-simple: possible read buffer overflow?
Date: Sat, 03 Oct 2009 21:02:56 +0200 [thread overview]
Message-ID: <4AC79FE0.6030008@gmail.com> (raw)
Prevent read from t_params->ranges[-1].
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
This is only required when t_params->count can be 0, can it?
Roel
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c
index 8abbcc5..e679d5f 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -266,7 +266,7 @@ static int simple_config_lookup(struct dvb_frontend *fe,
continue;
break;
}
- if (i == t_params->count) {
+ if (i == t_params->count && i) {
tuner_dbg("frequency out of range (%d > %d)\n",
*frequency, t_params->ranges[i - 1].limit);
*frequency = t_params->ranges[--i].limit;
next reply other threads:[~2009-10-03 18:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-03 19:02 Roel Kluin [this message]
2009-10-03 19:07 ` [PATCH] tuner-simple: possible read buffer overflow? Trent Piepho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AC79FE0.6030008@gmail.com \
--to=roel.kluin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox