]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Clear connect command message buffer
authorJouni Malinen <jouni@codeaurora.org>
Tue, 5 Feb 2019 18:34:34 +0000 (20:34 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Feb 2019 21:34:30 +0000 (23:34 +0200)
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>
src/drivers/driver_nl80211.c

index a5f5078c03f3c1fbd9c33dd64e278ab6a107978d..6f3ace99363621cc459a8d77d4f09751161952a7 100644 (file)
@@ -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;