]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - text-utils/ul.c
ul: make sure buffers are zeroized [coverity scan]
[thirdparty/util-linux.git] / text-utils / ul.c
index 3a9e31bc7b23a3cfacad6ca99138a1c202c0aa8d..e8137edbd88278b04b4c5ac480a2636c719abe68 100644 (file)
@@ -407,7 +407,7 @@ static void flushln(void)
 static void overstrike(void)
 {
        register int i;
-       register wchar_t *lbuf = xmalloc((maxcol + 1) * sizeof(wchar_t));
+       register wchar_t *lbuf = xcalloc(maxcol + 1, sizeof(wchar_t));
        register wchar_t *cp = lbuf;
        int hadbold=0;
 
@@ -446,7 +446,7 @@ static void overstrike(void)
 static void iattr(void)
 {
        register int i;
-       register wchar_t *lbuf = xmalloc((maxcol + 1) * sizeof(wchar_t));
+       register wchar_t *lbuf = xcalloc(maxcol + 1, sizeof(wchar_t));
        register wchar_t *cp = lbuf;
 
        for (i = 0; i < maxcol; i++)