mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 23:09:34 +01:00
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:
parent
0706a357a4
commit
f0848cc44a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user