From patchwork Sat Aug 20 11:08:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Rankin X-Patchwork-Id: 269 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 20 Aug 2011 11:08:43 +0000 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.20) for (single-drop); Sat, 20 Aug 2011 04:50:30 -0700 (PDT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QujPu-0007BG-Ks; Sat, 20 Aug 2011 11:08:42 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759Ab1HTLIj (ORCPT + 1 other); Sat, 20 Aug 2011 07:08:39 -0400 Received: from nm1.bt.bullet.mail.ird.yahoo.com ([212.82.108.232]:22480 "HELO nm1.bt.bullet.mail.ird.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752566Ab1HTLIj (ORCPT ); Sat, 20 Aug 2011 07:08:39 -0400 Received: from [212.82.108.231] by nm1.bt.bullet.mail.ird.yahoo.com with NNFMP; 20 Aug 2011 11:08:37 -0000 Received: from [212.82.108.227] by tm4.bt.bullet.mail.ird.yahoo.com with NNFMP; 20 Aug 2011 11:08:37 -0000 Received: from [127.0.0.1] by omp1004.bt.mail.ird.yahoo.com with NNFMP; 20 Aug 2011 11:08:37 -0000 X-Yahoo-Newman-Id: 839238.86665.bm@omp1004.bt.mail.ird.yahoo.com Received: (qmail 55301 invoked from network); 20 Aug 2011 11:08:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type; b=y8neIk/Z2H0R3ZpLRo82XMARFMdwobjDEIDvsxRDqdinRLQap9QH7e96mEcwkLlR1WDjjGNQuXMTYlP5awy9FlfmSNG5tI2ELWwMZ+yHU4nd32Bdi6qZ7nFYoRQ0xW57V9BXBDYgsrpC3unP8kzWNXmJfxxLEagAPgBPOmKFm+E= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1313838517; bh=IzfYXM3mIyHBdUrmm7X9ejMtZ4MIK0ecSUamwjqMNeQ=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type; b=b9mSMAGu2/Rcp9Nn0UfrcaH+aL/o6zFS39kDjmK+pzQ1QUsOc/mEL1ZOrcjze9c3jx7Jo2A2ezfbyGjArQpJgOUI00B/OE/aPcjOIfwuN7YOPVylz/adOtYFT9A/OU1I/NBGE5UkdsBPv1qqeGjCiOG+iiD1lemX2yNGFolKZNI= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: iXmI6A8VM1n2wV4PDREL3DIvko5OJgl16_bbdk.JFcCGclZ OgB4YL8VuTcq0VZo2pfD0cKDlHG1ClTOsSyLzwJ0fIkZ3rNUw.gGAPYExNbn Eo9GMh7Drt3CtkdHd8gSQMqbDcofvbnIDnLyrOEmXfonbJCovUHLK7mcbRUr EteT9UhP.pyBXupkpNPurpOGDpH98_fxQsbwLsVB5OV4pYHnaHkTDsYc29XW MMqMAMsHTEfcxQW11bDH083M2FBEH0WCZiolz6Hv50aM0JL95Dbzt5QEcNDD PRQgcY4v83hIsfbyI88_i8YJbF19vEixA1xOYjXeGAbqSlB37ZpOVuotM8Pe S.yTx5rIJF2qxadtc4ye0UmGl5p78iOZz2D7NrhuicFPMl_j_ZjQ3d3EQeLc 0 X-Yahoo-SMTP: dMK34oyswBBlfKesWTI5ovDjFOUFE6shtILt.ZXnUEjQHhWq Received: from wellhouse.underworld (rankincj@86.182.26.38 with login) by smtp817.mail.ukl.yahoo.com with SMTP; 20 Aug 2011 11:08:37 +0000 GMT Received: from volcano.underworld (volcano.underworld [192.168.0.3]) by wellhouse.underworld (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p7KB8Yqg011420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 20 Aug 2011 12:08:36 +0100 Message-ID: <4E4F95B2.9020703@yahoo.com> Date: Sat, 20 Aug 2011 12:08:34 +0100 From: Chris Rankin User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: Devin Heitmueller , linux-media@vger.kernel.org, Antti Palosaari Subject: [PATCH 1/6 ] EM28xx - pass correct buffer size to snprintf References: <4E4D5157.2080406@yahoo.com> <4E4D8DFD.5060800@yahoo.com> <4E4DFA65.4090508@redhat.com> In-Reply-To: <4E4DFA65.4090508@redhat.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org snprintf()'s size parameter includes space for the terminating '\0' character. Signed-off-by: Chris Rankin --- linux-3.0/drivers/media/video/em28xx/em28xx-cards.c.orig 2011-08-17 08:52:19.000000000 +0100 +++ linux-3.0/drivers/media/video/em28xx/em28xx-cards.c 2011-08-18 22:03:05.000000000 +0100 @@ -3085,7 +3085,7 @@ goto err; } - snprintf(dev->name, 29, "em28xx #%d", nr); + snprintf(dev->name, sizeof(dev->name), "em28xx #%d", nr); dev->devno = nr; dev->model = id->driver_info; dev->alt = -1;