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.
This commit is contained in:
Denis Kenzior 2019-06-26 10:43:38 -05:00
parent 0706a357a4
commit f0848cc44a
1 changed files with 2 additions and 2 deletions

View File

@ -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;