diff options
author | Karel Zak | 2010-11-04 22:22:49 +0100 |
---|---|---|
committer | Karel Zak | 2010-11-04 22:22:49 +0100 |
commit | 3f7fc4d43b61e442b81937aa06e079950a8ebb7c (patch) | |
tree | 90ef2646f98cc089d72b9fe36f1b43031a18d0bd /text-utils/column.c | |
parent | sys-utils: make use xalloc wrappers (diff) | |
download | kernel-qcow2-util-linux-3f7fc4d43b61e442b81937aa06e079950a8ebb7c.tar.gz kernel-qcow2-util-linux-3f7fc4d43b61e442b81937aa06e079950a8ebb7c.tar.xz kernel-qcow2-util-linux-3f7fc4d43b61e442b81937aa06e079950a8ebb7c.zip |
column: segfault on empty input
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=579955
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/column.c')
-rw-r--r-- | text-utils/column.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/text-utils/column.c b/text-utils/column.c index 87a6fc790..5b52339f6 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'); + } } } |