From: Jouni Malinen Date: Tue, 5 Feb 2019 18:34:34 +0000 (+0200) Subject: nl80211: Clear connect command message buffer X-Git-Tag: hostap_2_8~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fa33e05b47474040d7b1b87bf3bce485b7b430a;p=thirdparty%2Fhostap.git 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 --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index a5f5078c0..6f3ace993 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5716,9 +5716,10 @@ skip_auth_type: goto fail; 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 - ret = send_and_recv_msgs(drv, msg, NULL, NULL); + ret = send_and_recv_msgs(drv, msg, NULL, (void *) -1); msg = NULL; if (ret) { @@ -5730,6 +5731,7 @@ skip_auth_type: } fail: + nl80211_nlmsg_clear(msg); nlmsg_free(msg); return ret;