From patchwork Sat Oct 3 19:02:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 51549 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n93Iu71G006086 for ; Sat, 3 Oct 2009 18:56:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756808AbZJCSzf (ORCPT ); Sat, 3 Oct 2009 14:55:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756794AbZJCSzf (ORCPT ); Sat, 3 Oct 2009 14:55:35 -0400 Received: from ey-out-2122.google.com ([74.125.78.24]:60971 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754756AbZJCSze (ORCPT ); Sat, 3 Oct 2009 14:55:34 -0400 Received: by ey-out-2122.google.com with SMTP id 4so364405eyf.19 for ; Sat, 03 Oct 2009 11:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=3n5EJOpjXbEtLAWiwqzO7+CbBzlUawto4foDiZjEQ38=; b=N2IZNvfOJh946nQAgapYCEOaCbGZSEP1wUBF7gqlkbGDBdlRylGSCVVkCUcg5Evouh DVJyF+KIa+qm4Uv47N0AbejuDyH05aaCXWAJSRoOwjum2r57Xd7sCgot70wp82tqTrv9 ckTyphx91UxhFQXRYOyiUy8ccagjRxgGV5K94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=JPEjOmTgMKq72CwMFbxm0RTNCHuzQcj2dPqFBQV8gNJS5FdSL7H/FiwR7wJjNTAzxE mlTcLnEdQeKUe6O5nyIYU7lkVZ4aX/iWu7RUmWTU4uNQ1gBkvAgoqhgAHdigA5WaSDm4 hwiI2LKhZxJ9L4Svu2Nd3YpAI/FKO7NnmP5u8= Received: by 10.211.129.20 with SMTP id g20mr1279050ebn.14.1254596066572; Sat, 03 Oct 2009 11:54:26 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm761770eyg.27.2009.10.03.11.54.25 (version=SSLv3 cipher=RC4-MD5); Sat, 03 Oct 2009 11:54:26 -0700 (PDT) Message-ID: <4AC79FE0.6030008@gmail.com> Date: Sat, 03 Oct 2009 21:02:56 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 MIME-Version: 1.0 To: mchehab@redhat.com, linux-media@vger.kernel.org, Andrew Morton Subject: [PATCH] tuner-simple: possible read buffer overflow? Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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;