Use zero address when reporting unknown peer in SMK error
This avoids potential use of uninitialized stack memory when printing out peer address based on SMK error message that does not include the MAC address.
This commit is contained in:
parent
e4a6ea1d9c
commit
0e75b3c352
1 changed files with 2 additions and 0 deletions
|
@ -634,6 +634,8 @@ static int wpa_supplicant_process_smk_error(
|
||||||
|
|
||||||
if (kde.mac_addr && kde.mac_addr_len >= ETH_ALEN)
|
if (kde.mac_addr && kde.mac_addr_len >= ETH_ALEN)
|
||||||
os_memcpy(peer, kde.mac_addr, ETH_ALEN);
|
os_memcpy(peer, kde.mac_addr, ETH_ALEN);
|
||||||
|
else
|
||||||
|
os_memset(peer, 0, ETH_ALEN);
|
||||||
os_memcpy(&error, kde.error, sizeof(error));
|
os_memcpy(&error, kde.error, sizeof(error));
|
||||||
error_type = be_to_host16(error.error_type);
|
error_type = be_to_host16(error.error_type);
|
||||||
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
|
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
|
||||||
|
|
Loading…
Reference in a new issue