From 6110753b181f3912fc4866fbcfc488f1b6028f15 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 5 Feb 2019 20:36:28 +0200 Subject: [PATCH] nl80211: Clear PMKID add command message buffer 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 --- src/drivers/driver_nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 6f3ace993..0a70e22f7 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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); }