From 4f6e20c4310463c03a65fdde955e6891e1be3160 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 4 Dec 2010 10:30:01 +0100 Subject: [PATCH] xbps-bin: zero out allocated mem to avoid garbage in the 'list' target. --- bin/xbps-bin/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/xbps-bin/main.c b/bin/xbps-bin/main.c index 3c2e4a51..eba530f6 100644 --- a/bin/xbps-bin/main.c +++ b/bin/xbps-bin/main.c @@ -76,7 +76,7 @@ list_pkgs_in_dict(prop_object_t obj, void *arg, bool *loop_done) if (!pkgver && !short_desc) return EINVAL; - tmp = malloc(lpc->pkgver_len + 1); + tmp = calloc(1, lpc->pkgver_len + 1); if (tmp == NULL) return errno;