summaryrefslogtreecommitdiffstats
path: root/text-utils/display.c
diff options
context:
space:
mode:
authorPetr Uzel2011-08-10 15:32:28 +0200
committerKarel Zak2011-08-15 14:28:21 +0200
commitc53c38b90b9ca117fdf052c49934f6f2191bec63 (patch)
treee686659c01840b6ff6b42557132d4cebe31478d7 /text-utils/display.c
parentdmesg: avoid mess at the end of dmesg output (diff)
downloadkernel-qcow2-util-linux-c53c38b90b9ca117fdf052c49934f6f2191bec63.tar.gz
kernel-qcow2-util-linux-c53c38b90b9ca117fdf052c49934f6f2191bec63.tar.xz
kernel-qcow2-util-linux-c53c38b90b9ca117fdf052c49934f6f2191bec63.zip
hexdump: fix segfault due to uninitialized memory
util-linux commit 85bf44b714ab184907eb448eba389218956d6a51 replaced all calls to emalloc() with xmalloc(), whose semantics is however different - it does not zero allocated memory. This made hexdump segfault if MALLOC_PERTURB_ was set. Reported-by: Kyrill Detinov <lazy.kent@opensuse.org> Addresses: https://bugzilla.novell.com/show_bug.cgi?id=710877 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Diffstat (limited to 'text-utils/display.c')
-rw-r--r--text-utils/display.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/text-utils/display.c b/text-utils/display.c
index c700b0279..ad638e7f7 100644
--- a/text-utils/display.c
+++ b/text-utils/display.c
@@ -233,8 +233,8 @@ get(void)
u_char *tmpp;
if (!curp) {
- curp = xmalloc(blocksize);
- savp = xmalloc(blocksize);
+ curp = xcalloc(1, blocksize);
+ savp = xcalloc(1, blocksize);
} else {
tmpp = curp;
curp = savp;