From patchwork Sun Mar 28 11:21:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 3035 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 28 Mar 2010 11:21:48 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Sun, 28 Mar 2010 09:01:01 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NvqYu-0006tT-AA; Sun, 28 Mar 2010 11:21:48 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753952Ab0C1LVa (ORCPT + 1 other); Sun, 28 Mar 2010 07:21:30 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:34260 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752911Ab0C1LV3 (ORCPT ); Sun, 28 Mar 2010 07:21:29 -0400 Received: by bwz1 with SMTP id 1so2873795bwz.21 for ; Sun, 28 Mar 2010 04:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=gPZNvElVF8Y7LpefRqpJ4Mk43e3OTTO3UQXGICX01cI=; b=RPqac6pGVIOQ6+v1MtjqWrUSxEjkHyJvWSCz1DFRGEDrxUafJ0F+BtC0mwFQoOR4ja F/TulQaLCXEvyfu0FmWTUeCW5EJ7wyvZbZGgH/d66yP3/Trq3HQ0JyVwZVEscaRz0RSR D9VqKFsqWaAK8EXtwU/X+JqxrywbT2aRieg/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; b=WPNEh54lcs1nyPFG3aMMhtSX1NA7/t//LbEloVhMGDdh4we/SIEEp6ByXvHTww0fR6 AUMUADwr+prfk4JdM6dbWCyiWAxlCLusdPNYoYxmH8H0Em63yhNC8qQkMSlOl63cI/SY pusCFTaSKaCud6P7cHM7OeDGRgRuOPxwFmL/8= Received: by 10.204.6.23 with SMTP id 23mr2949533bkx.179.1269775287438; Sun, 28 Mar 2010 04:21:27 -0700 (PDT) Received: from bicker ([196.43.68.224]) by mx.google.com with ESMTPS id l1sm27181281bkl.2.2010.03.28.04.21.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Mar 2010 04:21:26 -0700 (PDT) Date: Sun, 28 Mar 2010 14:21:18 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Devin Heitmueller , Michael Krufky , Laurent Pinchart , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] video/au0828: off by one bug Message-ID: <20100328112118.GI5069@bicker> Mail-Followup-To: Dan Carpenter , Mauro Carvalho Chehab , Devin Heitmueller , Michael Krufky , Laurent Pinchart , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The "AUVI_INPUT(tmp)" macro uses "tmp" as an index of an array with AU0828_MAX_INPUT elements. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index dc67bc4..19a5773 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c @@ -1104,7 +1104,7 @@ static int vidioc_enum_input(struct file *file, void *priv, tmp = input->index; - if (tmp > AU0828_MAX_INPUT) + if (tmp >= AU0828_MAX_INPUT) return -EINVAL; if (AUVI_INPUT(tmp).type == 0) return -EINVAL;