From: Karel Zak Date: Thu, 4 Nov 2010 21:22:49 +0000 (+0100) Subject: column: segfault on empty input X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f7fc4d43b61e442b81937aa06e079950a8ebb7c;p=util-linux column: segfault on empty input Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=579955 Signed-off-by: Karel Zak --- diff --git a/text-utils/column.c b/text-utils/column.c index 87a6fc79..5b52339f 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -308,8 +308,10 @@ maketbl() for (i = lens[coloff] - t->len[coloff] + 2; i > 0; i--) putwchar(' '); } - fputws(t->list[coloff], stdout); - putwchar('\n'); + if (coloff < t->cols) { + fputws(t->list[coloff], stdout); + putwchar('\n'); + } } }