[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20230217131530.486962-1-n.petrova@fintech.ru>
Date: Fri, 17 Feb 2023 16:15:30 +0300
From: Natalia Petrova <n.petrova@...tech.ru>
To: Cezary Rojewski <cezary.rojewski@...el.com>
CC: Natalia Petrova <n.petrova@...tech.ru>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Liam Girdwood <liam.r.girdwood@...ux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Mark Brown <broonie@...nel.org>,
"Jaroslav Kysela" <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
<alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>,
<lvc-project@...uxtesting.org>
Subject: [PATCH] skl-topology_3627: using sprintf changed to snprintf
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 <n.petrova@...tech.ru>
---
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)) {
--
2.34.1
Powered by blists - more mailing lists