]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_scrub: fix buffer overflow in string_escape
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:22:08 +0000 (10:22 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:03 +0000 (09:16 -0800)
commita55329da927a0fc3cd7c219b9ef2df51a3ae964b
tree19dd5d7ab70143f83346eae8ab5decb175054ab6
parent8c4e704f370e0361c3e3dae5f8751ff580fa95a4
xfs_scrub: fix buffer overflow in string_escape

Need to allocate one more byte for the null terminator, just in case the
/entire/ input string consists of non-printable bytes e.g. emoji.

Cc: <linux-xfs@vger.kernel.org> # v4.15.0
Fixes: 396cd0223598bb ("xfs_scrub: warn about suspicious characters in directory/xattr names")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/common.c