]> err.no Git - util-linux/commitdiff
column: segfault on empty input
authorKarel Zak <kzak@redhat.com>
Thu, 4 Nov 2010 21:22:49 +0000 (22:22 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 4 Nov 2010 21:22:49 +0000 (22:22 +0100)
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=579955
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/column.c

index 87a6fc790abe4b67c671910eeff6723ec47441a5..5b52339f6a244cb4aada01e18942c92553a4c4d3 100644 (file)
@@ -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');
+               }
        }
 }