From 0fa33e05b47474040d7b1b87bf3bce485b7b430a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 5 Feb 2019 20:34:34 +0200 Subject: [PATCH] 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 --- src/drivers/driver_nl80211.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;