findmnt: always zero-terminate SOURCES data
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 21 Apr 2024 18:00:31 +0000 (20:00 +0200)
committerChris Hofstaedtler <zeha@debian.org>
Sat, 27 Apr 2024 12:23:31 +0000 (14:23 +0200)
commit8ee118d0d2c73e40e694cbd7359ffb82d036191d
tree329c80cd6d6e7ddbd9cda1e094145d6fead67a75
parent224d2cd48b9e90cae3b818b7d6e8b78855d1c9aa
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>
(cherry picked from commit 6594679e9af805075c282da35b1b2a8d767e403b)

Gbp-Pq: Topic upstream
Gbp-Pq: Name findmnt-always-zero-terminate-SOURCES-data.patch
misc-utils/findmnt.c