skl-topology_3627: using sprintf changed to snprintf
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- sound/soc/intel/skylake/skl-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/skylake/skl-topology.c +1 -1
@@ -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)) {
Signature · 1 line
2.34.1