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:
Jouni Malinen 2010-01-10 19:00:25 +02:00
parent e4a6ea1d9c
commit 0e75b3c352

View file

@ -634,6 +634,8 @@ static int wpa_supplicant_process_smk_error(
if (kde.mac_addr && kde.mac_addr_len >= ETH_ALEN)
os_memcpy(peer, kde.mac_addr, ETH_ALEN);
else
os_memset(peer, 0, ETH_ALEN);
os_memcpy(&error, kde.error, sizeof(error));
error_type = be_to_host16(error.error_type);
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,