Skip to content

Commit 88a7bc8

Browse files
committed
ALSA: hda/ca0132: Fix buffer overflow in add_tuning_control
jira VULN-152898 cve CVE-2025-39751 commit-author Lucy Thrun <[email protected]> commit a409c60 The 'sprintf' call in 'add_tuning_control' may exceed the 44-byte buffer if either string argument is too long. This triggers a compiler warning. Replaced 'sprintf' with 'snprintf' to limit string lengths to prevent overflow. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Lucy Thrun <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]> (cherry picked from commit a409c60) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent 67243d5 commit 88a7bc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/pci/hda/patch_ca0132.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4399,7 +4399,7 @@ static int add_tuning_control(struct hda_codec *codec,
43994399
}
44004400
knew.private_value =
44014401
HDA_COMPOSE_AMP_VAL(nid, 1, 0, type);
4402-
sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
4402+
snprintf(namestr, sizeof(namestr), "%s %s Volume", name, dirstr[dir]);
44034403
return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
44044404
}
44054405

0 commit comments

Comments
 (0)