]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
libhandle: fix potential unterminated string problem
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 12 Oct 2020 15:59:19 +0000 (11:59 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 12 Oct 2020 15:59:19 +0000 (11:59 -0400)
commitf4d026454335c4808b5ab8aa44e4eb51a916d9ff
tree2d713323edfba30f055fcece389eeda2b4a71d73
parent0779e54dc66f5c09a80be3a0a7d782edf464bbb8
libhandle: fix potential unterminated string problem

gcc 10.2 complains about the strncpy call here, since it's possible that
the source string is so long that the fspath inside the fdhash structure
will end up without a null terminator.  Work around strncpy braindamage
yet again by forcing the string to be terminated properly.

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>
libhandle/handle.c