]> source.dussan.org Git - rspamd.git/commitdiff
Do not check uninitialized bytes.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Mar 2015 13:59:59 +0000 (13:59 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Mar 2015 13:59:59 +0000 (13:59 +0000)
src/libutil/addr.c

index 7a9c4955790832f64f5497b56324f2d9b60ada0d..2db961574fd99641339ede83aeadad77fd445fcc 100644 (file)
@@ -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;