aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_priv.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-03 15:32:07 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-03 15:46:08 (GMT)
commitce0f899a3d9bdf6ed26e92ebfd14c623db033ae3 (patch)
tree7d1fa162cbd083ef3fe8de8e4a538787c9cb67d3 /wpa_supplicant/wpa_priv.c
parente0641772a32993d1cbe7e66d4b9a304cf3712124 (diff)
downloadhostap-ce0f899a3d9bdf6ed26e92ebfd14c623db033ae3.zip
hostap-ce0f899a3d9bdf6ed26e92ebfd14c623db033ae3.tar.gz
hostap-ce0f899a3d9bdf6ed26e92ebfd14c623db033ae3.tar.bz2
wpa_priv: Explicitly clear padding in message structures
This avoids some valgrind warnings about use of uninitialized memory in cases where a struct may have padding octets between the fields. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wpa_priv.c')
-rw-r--r--wpa_supplicant/wpa_priv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 7b989ce..11905f3 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -346,6 +346,7 @@ static void wpa_priv_cmd_get_ssid(struct wpa_priv_interface *iface,
if (iface->driver->get_ssid == NULL)
goto fail;
+ os_memset(ssid, 0, sizeof(ssid));
res = iface->driver->get_ssid(iface->drv_priv, &ssid[sizeof(int)]);
if (res < 0 || res > SSID_MAX_LEN)
goto fail;
@@ -857,7 +858,7 @@ static void wpa_priv_send_auth(struct wpa_priv_interface *iface,
struct privsep_event_auth *auth;
u8 *buf, *pos;
- buf = os_malloc(buflen);
+ buf = os_zalloc(buflen);
if (buf == NULL)
return;