From patchwork Fri Feb 17 13:15:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natalia Petrova X-Patchwork-Id: 13144808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59156C05027 for ; Fri, 17 Feb 2023 14:16:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3CBC1F44; Fri, 17 Feb 2023 15:15:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3CBC1F44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1676643377; bh=68R7vM2WSqKHQH6K9b4DPoGlc/nETcFl/uxkEbukG2k=; h=From:To:Subject:Date:CC:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=jDk/Vu15qmdwXyaKJdicOG+D+70ZCN6wvxBzBIgRhbWfysQ9y489hjbKYvibcfJsG o/ERWMXgsynmbjFRuTMAzuxeSEccCSAWsy5/Dk/s4sk6HHKwJeeWPhm3sanjh0ZsIs 4jEbtWab3tWno17g2B7gs7nNCQW5iyfmyEMqtsAc= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8E43FF80526; Fri, 17 Feb 2023 15:14:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E3DB1F801C0; Fri, 17 Feb 2023 14:15:44 +0100 (CET) Received: from exchange.fintech.ru (e10edge.fintech.ru [195.54.195.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E4E39F800AA for ; Fri, 17 Feb 2023 14:15:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E4E39F800AA Received: from Ex16-01.fintech.ru (10.0.10.18) by exchange.fintech.ru (195.54.195.159) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 17 Feb 2023 16:15:33 +0300 Received: from KANASHIN1.fintech.ru (10.0.253.125) by Ex16-01.fintech.ru (10.0.10.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 17 Feb 2023 16:15:33 +0300 From: Natalia Petrova To: Cezary Rojewski Subject: [PATCH] skl-topology_3627: using sprintf changed to snprintf Date: Fri, 17 Feb 2023 16:15:30 +0300 Message-ID: <20230217131530.486962-1-n.petrova@fintech.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.0.253.125] X-ClientProxiedBy: Ex16-01.fintech.ru (10.0.10.18) To Ex16-01.fintech.ru (10.0.10.18) X-MailFrom: n.petrova@fintech.ru X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: 7PMZEBG73NIS52TML44MGJPEEJBQURBY X-Message-ID-Hash: 7PMZEBG73NIS52TML44MGJPEEJBQURBY X-Mailman-Approved-At: Fri, 17 Feb 2023 14:14:27 +0000 CC: Natalia Petrova , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use snprintf instead of sprintf to avoid buffer overflow. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 2d744ecf2b98 ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT") Signed-off-by: Natalia Petrova --- sound/soc/intel/skylake/skl-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index e06eac592da1..ac06926e651d 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -3660,7 +3660,7 @@ static int skl_tplg_complete(struct snd_soc_component *component) se = (struct soc_enum *)kcontrol->private_value; texts = dobj->control.dtexts; - sprintf(chan_text, "c%d", mach->mach_params.dmic_num); + snprintf(chan_text, sizeof(chan_text), "c%d", mach->mach_params.dmic_num); for (i = 0; i < se->items; i++) { if (strstr(texts[i], chan_text)) {