From: Karel Zak Date: Tue, 31 Aug 2021 10:31:15 +0000 (+0200) Subject: column: segmentation fault on invalid unicode input passed to -s option X-Git-Tag: v2.38-rc1~266 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9714331843ef3a6d9c10ff1d3bc5fcf53d44d930;p=thirdparty%2Futil-linux.git column: segmentation fault on invalid unicode input passed to -s option The function mbs_to_wcs() returns NULL on invalid UTF. Fixes: https://github.com/karelzak/util-linux/issues/1425 Signed-off-by: Karel Zak --- diff --git a/text-utils/column.c b/text-utils/column.c index 1bc90e84e3..f9878e4422 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -814,6 +814,8 @@ int main(int argc, char **argv) case 's': free(ctl.input_separator); ctl.input_separator = mbs_to_wcs(optarg); + if (!ctl.input_separator) + err(EXIT_FAILURE, _("failed to use input separator")); ctl.greedy = 0; break; case 'T':