EDAC/armada_xp: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:17:28 +0000 (08:17 +0100)
committerBorislav Petkov <bp@suse.de>
Tue, 17 Mar 2020 18:26:09 +0000 (19:26 +0100)
commit215a423cc0799b054bdabbc5ba68a7178924621d
tree63e0a31af0f2d2651fe745b2b51c83a54931fdc6
parent52cff04a81e9571735976e4d70984e89a7ee3885
EDAC/armada_xp: 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>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Jan Luebbe <jlu@pengutronix.de>
Link: https://lkml.kernel.org/r/20200311071728.4541-1-tiwai@suse.de
drivers/edac/armada_xp_edac.c