]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Clear PMKID add command message buffer
authorJouni Malinen <jouni@codeaurora.org>
Tue, 5 Feb 2019 18:36:28 +0000 (20:36 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Feb 2019 21:34:30 +0000 (23:34 +0200)
This command has now been extended to include PMK for offload needs, so
the message buffer needs to be cleared explicitly after use to avoid
leaving such material in heap memory unnecessarily.

Fixes: 061a3d3d5300 ("nl80211: Add support for FILS Cache Identifier in add/remove_pmkid()")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/drivers/driver_nl80211.c

index 6f3ace99363621cc459a8d77d4f09751161952a7..0a70e22f799af865f1a5c64844957b74bb85340d 100644 (file)
@@ -7929,11 +7929,12 @@ static int nl80211_pmkid(struct i802_bss *bss, int cmd,
                     params->fils_cache_id)) ||
            (params->pmk_len && params->pmk_len <= PMK_MAX_LEN &&
             nla_put(msg, NL80211_ATTR_PMK, params->pmk_len, params->pmk))) {
+               nl80211_nlmsg_clear(msg);
                nlmsg_free(msg);
                return -ENOBUFS;
        }
 
-       return send_and_recv_msgs(bss->drv, msg, NULL, NULL);
+       return send_and_recv_msgs(bss->drv, msg, NULL, (void *) -1);
 }