From 9154d4f68d648fe643070f3c7a8a1880d039d335 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 7 Nov 2015 00:20:56 +0000 Subject: [PATCH] Fix inet_addr structure length in memcpy --- src/libutil/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 7d0d5fef9..039474378 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -845,7 +845,7 @@ rspamd_inet_address_recvfrom (gint fd, void *buf, gsize len, gint fl, memcpy (&addr->u.un->addr, &su.su, sizeof (struct sockaddr_un)); } else { - memcpy (&addr->u.in.addr, &su, MIN (len, sizeof (addr->u.in.addr))); + memcpy (&addr->u.in.addr, &su.sa, MIN (slen, sizeof (addr->u.in.addr))); } *target = addr; -- 2.39.5