Skip to content
Unverified Commit 6c89ffea authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown
Browse files

ASoC: pcm: Fix possible buffer overflow in dpcm state sysfs output



dpcm_show_state() invokes multiple snprintf() calls to concatenate
formatted strings on the fixed size buffer.  The usage of snprintf()
is supposed for avoiding the buffer overflow, but it doesn't work as
expected because snprintf() doesn't return the actual output size but
the size to be written.

Fix this bug by replacing all snprintf() calls with scnprintf()
calls.

Fixes: f86dcef8 ("ASoC: dpcm: Add debugFS support for DPCM")
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200218111737.14193-4-tiwai@suse.de


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 549cd0ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment