mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 10:54:03 -05:00
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>
This commit is contained in:
parent
e0641772a3
commit
ce0f899a3d
@ -346,6 +346,7 @@ static void wpa_priv_cmd_get_ssid(struct wpa_priv_interface *iface,
|
|||||||
if (iface->driver->get_ssid == NULL)
|
if (iface->driver->get_ssid == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
os_memset(ssid, 0, sizeof(ssid));
|
||||||
res = iface->driver->get_ssid(iface->drv_priv, &ssid[sizeof(int)]);
|
res = iface->driver->get_ssid(iface->drv_priv, &ssid[sizeof(int)]);
|
||||||
if (res < 0 || res > SSID_MAX_LEN)
|
if (res < 0 || res > SSID_MAX_LEN)
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -857,7 +858,7 @@ static void wpa_priv_send_auth(struct wpa_priv_interface *iface,
|
|||||||
struct privsep_event_auth *auth;
|
struct privsep_event_auth *auth;
|
||||||
u8 *buf, *pos;
|
u8 *buf, *pos;
|
||||||
|
|
||||||
buf = os_malloc(buflen);
|
buf = os_zalloc(buflen);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user