]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: don't print arrays off the end of a buffer
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 2 May 2017 16:12:54 +0000 (11:12 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 2 May 2017 16:12:54 +0000 (11:12 -0500)
commit966ef874a8920c238d24b45bd1e8697b8dfcd4da
treefeef9b06ff3b73ba71d0538b2924df73c061e0b6
parent23069a9353eb8af30f3427feed6c92380d025a53
xfs_db: don't print arrays off the end of a buffer

Before printing an array, clamp the array count against the size of the
buffer so that we don't print random heap contents.

[sandeen: re-use fsz variable in call to prfunc]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/print.c