]> 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)
committerKarel Zak <kzak@redhat.com>
Mon, 22 Apr 2024 10:07:37 +0000 (12:07 +0200)
commit9e187d83861cd0b01aefc6f20326259b3dbe1303
treee3c90a6fa6d13f48cf432b23de0fb847903c2820
parent32cc417009a26a095924fda415e53e82a917af0e
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)
misc-utils/findmnt.c