From f0848cc44a144745d1fa54d4a7ba2d1741a15160 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 26 Jun 2019 10:43:38 -0500 Subject: [PATCH] rtnlutil: Don't use explicit_bzero Use memset instead. explicit_bzero should only be used when we're wiping a secret just prior to the encopassing storage being freed. The compiler would usually optimize away the memset, leaving the secrets around. In rtnlutil we're simply zeroing the structure prior to filling it, so the use of explicit_bzero is not needed and brings confusion to the reader since no secrets are being wiped. --- src/rtnlutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtnlutil.c b/src/rtnlutil.c index 18be6f47..7e1143c5 100644 --- a/src/rtnlutil.c +++ b/src/rtnlutil.c @@ -131,7 +131,7 @@ uint32_t rtnl_ifaddr_get(struct l_netlink *rtnl, l_netlink_command_func_t cb, uint32_t id; rtmmsg = l_malloc(sizeof(struct ifaddrmsg)); - explicit_bzero(rtmmsg, sizeof(struct ifaddrmsg)); + memset(rtmmsg, 0, sizeof(struct ifaddrmsg)); rtmmsg->ifa_family = AF_INET; @@ -162,7 +162,7 @@ static uint32_t rtnl_ifaddr_change(struct l_netlink *rtnl, uint16_t nlmsg_type, RTA_SPACE(sizeof(struct in_addr)); rtmmsg = l_malloc(bufsize); - explicit_bzero(rtmmsg, bufsize); + memset(rtmmsg, 0, bufsize); rtmmsg->ifa_index = ifindex; rtmmsg->ifa_family = AF_INET;