From 2576635a55ee85c9542d3292d1e6551a5b75ea48 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 25 May 2017 12:38:49 +0100 Subject: [CritFix] Zero fill sockaddr_un --- src/libutil/addr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/libutil/addr.c') diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 9a278a432..b4ee003ba 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -112,10 +112,8 @@ rspamd_inet_addr_create (gint af) addr = g_slice_alloc0 (sizeof (rspamd_inet_addr_t)); if (af == AF_UNIX) { - addr->u.un = g_slice_alloc (sizeof (*addr->u.un)); + addr->u.un = g_slice_alloc0 (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; -- cgit v1.2.3