summaryrefslogtreecommitdiffstats
path: root/text-utils
diff options
context:
space:
mode:
authorKarel Zak2019-05-28 13:33:03 +0200
committerKarel Zak2019-05-28 13:33:03 +0200
commitb8b7f4745cb971030700095262b05b278def9a20 (patch)
tree6338a02729d694efcfc6a6ad5f9e78734e8422cd /text-utils
parentcolumn: make code more robust [coverity scan] (diff)
downloadkernel-qcow2-util-linux-b8b7f4745cb971030700095262b05b278def9a20.tar.gz
kernel-qcow2-util-linux-b8b7f4745cb971030700095262b05b278def9a20.tar.xz
kernel-qcow2-util-linux-b8b7f4745cb971030700095262b05b278def9a20.zip
ul: make sure buffers are zeroized [coverity scan]
Diffstat (limited to 'text-utils')
-rw-r--r--text-utils/ul.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/text-utils/ul.c b/text-utils/ul.c
index 3a9e31bc7..e8137edbd 100644
--- a/text-utils/ul.c
+++ b/text-utils/ul.c
@@ -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++)