]> git.baikalelectronics.ru Git - kernel.git/commit
staging: most: core: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 09:19:44 +0000 (10:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 08:23:59 +0000 (09:23 +0100)
commit0608f8cba3818d776078cee08f912d60fcdc1d5c
treed23aeb75b09d4004e0716308af1254c8f93efc01
parenta43d9024ead8599694baaeef3981f199be9a4fcd
staging: most: core: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200311091944.23185-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/core.c