]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: fix WRAPNL crashes
authorKarel Zak <kzak@redhat.com>
Mon, 12 Sep 2016 09:58:34 +0000 (11:58 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 12 Sep 2016 09:58:34 +0000 (11:58 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/344
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/table_print.c

index bdac0b296d6a3e13678c096c465304b34bf8cf62..7355fe8e1fa06f84d469140d43c1299fc8ab2850 100644 (file)
@@ -333,7 +333,7 @@ static int set_pending_data(struct libscols_column *cl, const char *data, size_t
 {
        char *p = NULL;
 
-       if (data) {
+       if (data && *data) {
                DBG(COL, ul_debugobj(cl, "setting pending data"));
                assert(sz);
                p = strdup(data);