From patchwork Sun Oct 19 07:11:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 5100631 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 21E289F374 for ; Sun, 19 Oct 2014 07:12:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 633E3201C7 for ; Sun, 19 Oct 2014 07:12:25 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 74B0F201C0 for ; Sun, 19 Oct 2014 07:12:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 810CB260672; Sun, 19 Oct 2014 09:12:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7D8362605B9; Sun, 19 Oct 2014 09:11:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DD7892605BE; Sun, 19 Oct 2014 09:11:45 +0200 (CEST) Received: from mail.zonque.de (svenfoo.org [82.94.215.22]) by alsa0.perex.cz (Postfix) with ESMTP id 0D30A2604FD for ; Sun, 19 Oct 2014 09:11:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 805FCC00E5; Sun, 19 Oct 2014 09:11:34 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3_FLF5GszSiD; Sun, 19 Oct 2014 09:11:34 +0200 (CEST) Received: from tamtam.fritz.box (p54AF4931.dip0.t-ipconnect.de [84.175.73.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id 07E34C08F8; Sun, 19 Oct 2014 09:11:33 +0200 (CEST) From: Daniel Mack To: alsa-devel@alsa-project.org Date: Sun, 19 Oct 2014 09:11:26 +0200 Message-Id: <1413702686-8751-2-git-send-email-daniel@zonque.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1413702686-8751-1-git-send-email-daniel@zonque.org> References: <1413702686-8751-1-git-send-email-daniel@zonque.org> Cc: tiwai@suse.de, Daniel Mack Subject: [alsa-devel] [PATCH 2/2] ALSA: snd-usb: use strncpy() in mixer_quirks.c X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Out of principles, use strncpy() in favor of strcpy(). That is, however, an insignificant detail here. Signed-off-by: Daniel Mack --- sound/usb/mixer_quirks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index f119a41..f406305 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -446,8 +446,9 @@ static int snd_emu0204_ch_switch_info(struct snd_kcontrol *kcontrol, uinfo->value.enumerated.items = 2; if (uinfo->value.enumerated.item > 1) uinfo->value.enumerated.item = 1; - strcpy(uinfo->value.enumerated.name, - texts[uinfo->value.enumerated.item]); + strncpy(uinfo->value.enumerated.name, + texts[uinfo->value.enumerated.item], + sizeof(uinfo->value.enumerated.name) - 1); return 0; }