OSDN Git Service

misc: mic: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:49:16 +0000 (08:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 11:24:19 +0000 (12:24 +0100)
commitd108b132ea39cdcd63a1d6b4460fc4c7d183c7e5
tree1183967275197a2294b2cb366457aa32ca392587
parentf276d3ea884d1fedbdf9bc88cdd64e8ab4367ff9
misc: mic: 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/20200311074916.8783-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mic/host/mic_x100.c