From patchwork Wed Oct 7 15:56:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: iceberg X-Patchwork-Id: 52255 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 n97C1bmQ001755 for ; Wed, 7 Oct 2009 12:01:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932650AbZJGLy5 (ORCPT ); Wed, 7 Oct 2009 07:54:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932394AbZJGLy4 (ORCPT ); Wed, 7 Oct 2009 07:54:56 -0400 Received: from smtp.ispras.ru ([83.149.198.201]:42388 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753998AbZJGLy4 (ORCPT ); Wed, 7 Oct 2009 07:54:56 -0400 Received: from ispserv.ispras.ru (ispserv.ispras.ru [83.149.198.72]) by smtp.ispras.ru (Postfix) with ESMTP id 9A7505D41A0; Wed, 7 Oct 2009 15:19:01 +0400 (MSD) Received: from pamir.localnet (pamir.kazbek.ispras.ru [83.149.199.144]) by ispserv.ispras.ru (Postfix) with ESMTP id BC2463FC48; Wed, 7 Oct 2009 15:54:18 +0400 (MSD) From: Alexander Strakh Organization: ISP RAS To: Jaya Kumar , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] quickcam_messenger.c: possible buffer overflow while use strncat. Date: Wed, 7 Oct 2009 15:56:54 +0000 User-Agent: KMail/1.10.3 (Linux/2.6.27.29-0.1-default; KDE/4.1.3; x86_64; ; ) MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200910071556.54534.strakh@ispras.ru> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/./a/drivers/media/video/usbvideo/quickcam_messenger.c b/./b/drivers/media/video/usbvideo/quickcam_messenger.c index 803d3e4..c4d1b96 100644 --- a/./a/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/./b/drivers/media/video/usbvideo/quickcam_messenger.c @@ -89,7 +89,7 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev) 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();