]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 18:15:35 +0000 (11:15 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Mar 2020 14:58:13 +0000 (07:58 -0700)
commit89243ec547d1a301743696324732f92eece6d446
tree26dbeb5f5b4e5d37febca2fe6f617739e0b66912
parentfa65b00be6dfe80fb6eff8d22043eb984fea8842
xfs: 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>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_stats.c