]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: Intel: hda: Fix potential buffer overflow by snprintf()
authorTakashi Iwai <tiwai@suse.de>
Mon, 1 Aug 2022 16:54:20 +0000 (18:54 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 5 Aug 2022 11:57:24 +0000 (12:57 +0100)
commit2837393337da7483777a40b6994a582e2e298d94
treee49d49ffa96091d16bfe72238124b6aeab7cfbb9
parent8603ad8ab7b5e5524d18e9067bdfac18f4d8969a
ASoC: SOF: Intel: hda: Fix potential buffer overflow by snprintf()

snprintf() returns the would-be-filled size when the string overflows
the given buffer size, hence using this value may result in the buffer
overflow (although it's unrealistic).

This patch replaces with a safer version, scnprintf() for papering
over such a potential issue.

Fixes: e8b680a6bfe0 ("ASoC: SOF: Intel: hda: add extended rom status dump to error log")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220801165420.25978-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda.c