nl80211: Clear connect command message buffer

This command can include keys (WEP or PSK for offload), so the message
buffer needs to be cleared explicitly after use to avoid leaving such
material in heap memory unnecessarily.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-02-05 20:34:34 +02:00 committed by Jouni Malinen
parent b14e8ea1d2
commit 0fa33e05b4

View file

@ -5716,9 +5716,10 @@ skip_auth_type:
goto fail; goto fail;
if (nl_connect) if (nl_connect)
ret = send_and_recv(drv->global, nl_connect, msg, NULL, NULL); ret = send_and_recv(drv->global, nl_connect, msg,
NULL, (void *) -1);
else else
ret = send_and_recv_msgs(drv, msg, NULL, NULL); ret = send_and_recv_msgs(drv, msg, NULL, (void *) -1);
msg = NULL; msg = NULL;
if (ret) { if (ret) {
@ -5730,6 +5731,7 @@ skip_auth_type:
} }
fail: fail:
nl80211_nlmsg_clear(msg);
nlmsg_free(msg); nlmsg_free(msg);
return ret; return ret;