From 3f7fc4d43b61e442b81937aa06e079950a8ebb7c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 4 Nov 2010 22:22:49 +0100 Subject: [PATCH] column: segfault on empty input Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=579955 Signed-off-by: Karel Zak --- text-utils/column.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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'); + } } } -- 2.39.5