]> git.ipfire.org Git - thirdparty/util-linux.git/commit
findmnt: always zero-terminate SOURCES data
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 21 Apr 2024 18:00:31 +0000 (20:00 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 21 Apr 2024 18:00:31 +0000 (20:00 +0200)
commit6594679e9af805075c282da35b1b2a8d767e403b
tree047615d6737b44556bfbcc4958ca10ed9447d00e
parenta6d12b403eec9f3fddc0fa82325dac04826c4b48
findmnt: always zero-terminate SOURCES data

libsmartcols expects it's data fields to be zero terminated.
See the call to strlen() in scols_column_greatest_wrap().
ul_buffer however does not guarantee that termination,
ul_buffer_append_strings() discard the zero-termination.

Always zero-terminate in get_data_col_sources() and drop the now
unnecessary variable "i".

Closes: https://github.com/util-linux/util-linux/issues/2980
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
misc-utils/findmnt.c