]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
column: don't ignore mbs_to_wcs() errors
authorKarel Zak <kzak@redhat.com>
Thu, 2 Mar 2017 13:04:47 +0000 (14:04 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 2 May 2017 10:17:59 +0000 (12:17 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/column.c

index 51a5b8efd8d288528fc64863a504f83b2d353327..d912369592dc308dd02f6cf53da01f09a3dbdbe6 100644 (file)
@@ -444,6 +444,8 @@ static int input(struct column_control *ctl, FILE *fp)
                                                maxents * sizeof(wchar_t *));
                        }
                        ctl->ents[ctl->nents] = mbs_to_wcs(str);
+                       if (!ctl->ents[ctl->nents])
+                               err(EXIT_FAILURE, _("read failed"));
                        len = width(ctl->ents[ctl->nents]);
                        if (ctl->maxlength < len)
                                ctl->maxlength = len;