From: Vsevolod Stakhov Date: Fri, 13 Mar 2015 13:59:59 +0000 (+0000) Subject: Do not check uninitialized bytes. X-Git-Tag: 0.9.0~497 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4145af538a569721ee289331acf2f013d40c6558;p=rspamd.git Do not check uninitialized bytes. --- diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 7a9c49557..2db961574 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -105,11 +105,13 @@ rspamd_inet_addr_create (gint af) { rspamd_inet_addr_t *addr; - addr = g_slice_alloc (sizeof (rspamd_inet_addr_t)); + addr = g_slice_alloc0 (sizeof (rspamd_inet_addr_t)); if (af == AF_UNIX) { addr->u.un = g_slice_alloc (sizeof (*addr->u.un)); addr->slen = sizeof (addr->u.un->addr); + /* Zero terminate to avoid issues with SUN_LEN */ + addr->u.un->addr.sun_path[0] = '\0'; } addr->af = af;