From patchwork Sat Nov 21 16:46:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOpbWV0aCBNw6FydG9u?= X-Patchwork-Id: 2153 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 21 Nov 2009 16:46:48 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for (single-drop); Sat, 21 Nov 2009 14:47:59 -0200 (BRST) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NBt6m-00071s-Kf; Sat, 21 Nov 2009 16:46:48 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755629AbZKUQqT (ORCPT + 1 other); Sat, 21 Nov 2009 11:46:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755503AbZKUQqT (ORCPT ); Sat, 21 Nov 2009 11:46:19 -0500 Received: from mail01a.mail.t-online.hu ([84.2.40.6]:51624 "EHLO mail01a.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755479AbZKUQqS (ORCPT ); Sat, 21 Nov 2009 11:46:18 -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 mail01a.mail.t-online.hu (Postfix) with ESMTPSA id E7683798631; Sat, 21 Nov 2009 17:45:28 +0100 (CET) Message-ID: <4B081954.5020907@freemail.hu> Date: Sat, 21 Nov 2009 17:46:12 +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: Mauro Carvalho Chehab , v4L Mailing List CC: cocci@diku.dk, LKML Subject: [PATCH] dvb ttusb-dec: do not overwrite the first part of phys string References: <4B079CE0.60604@freemail.hu> In-Reply-To: <4B079CE0.60604@freemail.hu> X-DCC-mail.t-online.hu-Metrics: mail01a.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 From: Márton Németh Use strlcat() to append a string to the previously created first part. The semantic match that finds this kind of problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression dev; expression phys; expression str; expression size; @@ usb_make_path(dev, phys, size); - strlcpy(phys, str, size); + strlcat(phys, str, size); // Signed-off-by: Márton Németh --- -- 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 -u -p a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-09-10 00:13:59.000000000 +0200 +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-11-21 17:30:10.000000000 +0100 @@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_d int err; usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys)); - strlcpy(dec->rc_phys, "/input0", sizeof(dec->rc_phys)); + strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys)); input_dev = input_allocate_device(); if (!input_dev)