From patchwork Sat Nov 21 17:02:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TsODwqltZXRoIE3Dg8KhcnRvbg==?= X-Patchwork-Id: 61958 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 nALH3566000606 for ; Sat, 21 Nov 2009 17:03:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756068AbZKURC6 (ORCPT ); Sat, 21 Nov 2009 12:02:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756061AbZKURC6 (ORCPT ); Sat, 21 Nov 2009 12:02:58 -0500 Received: from mail01d.mail.t-online.hu ([84.2.42.6]:59913 "EHLO mail01d.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755957AbZKURC5 (ORCPT ); Sat, 21 Nov 2009 12:02:57 -0500 Received: from [192.168.1.64] (dsl51B6C41D.pool.t-online.hu [81.182.196.29]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01d.mail.t-online.hu (Postfix) with ESMTPSA id 7E1AD758E76; Sat, 21 Nov 2009 18:02:16 +0100 (CET) Message-ID: <4B081D40.9030607@freemail.hu> Date: Sat, 21 Nov 2009 18:02:56 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Laurent Pinchart , V4L Mailing List CC: cocci@diku.dk, LKML Subject: [PATCH] usbvideo: limit the length of string creation X-DCC-mail.t-online.hu-Metrics: mail01d.mail.t-online.hu 32711; Body=4 Fuz1=4 Fuz2=4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff -u -p a/drivers/media/video/usbvideo/konicawc.c b/drivers/media/video/usbvideo/konicawc.c --- a/drivers/media/video/usbvideo/konicawc.c 2009-09-10 00:13:59.000000000 +0200 +++ b/drivers/media/video/usbvideo/konicawc.c 2009-11-21 17:48:52.000000000 +0100 @@ -225,7 +225,7 @@ static void konicawc_register_input(stru int error; usb_make_path(dev, cam->input_physname, sizeof(cam->input_physname)); - strncat(cam->input_physname, "/input0", sizeof(cam->input_physname)); + strlcat(cam->input_physname, "/input0", sizeof(cam->input_physname)); cam->input = input_dev = input_allocate_device(); if (!input_dev) { diff -u -p a/drivers/media/video/usbvideo/quickcam_messenger.c b/drivers/media/video/usbvideo/quickcam_messenger.c --- a/drivers/media/video/usbvideo/quickcam_messenger.c 2009-09-10 00:13:59.000000000 +0200 +++ b/drivers/media/video/usbvideo/quickcam_messenger.c 2009-11-21 17:48:53.000000000 +0100 @@ -89,7 +89,7 @@ static void qcm_register_input(struct qc int error; usb_make_path(dev, cam->input_physname, sizeof(cam->input_physname)); - strncat(cam->input_physname, "/input0", sizeof(cam->input_physname)); + strlcat(cam->input_physname, "/input0", sizeof(cam->input_physname)); cam->input = input_dev = input_allocate_device(); if (!input_dev) {