]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/sysfs: zero-terminate result of sysfs_blkdev_get_devchain()
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 12 Jun 2024 21:32:15 +0000 (23:32 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Thu, 13 Jun 2024 09:46:03 +0000 (11:46 +0200)
commit24e3ede3dab15fcbf18d16ac09ae57ba4827c4b5
treee10aa6f374ca12fd2f88dcb4ab8b8b23867ba438
parent49e177d627f80640aac81522090cbdc151204c2d
lib/sysfs: zero-terminate result of sysfs_blkdev_get_devchain()

sysfs_blkdev_get_devchain() does not zero-terminate its result, but the
caller expects a C-string.
Use ul_buffer_get_string() which includes a trailing zero-byte.

Now it's also valid for sz and bufsz to be equal.

See #3088.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
lib/sysfs.c