aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mesh_mpm.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-11-30 13:46:09 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-30 13:53:11 (GMT)
commit608b0ff52a9533d067c30cead6ed881bd593e006 (patch)
tree5b822572d555ffce393199fab510f81955c2ce83 /wpa_supplicant/mesh_mpm.c
parentfaa907389b1f0ceaa1f3d2948cef1e45d046d92e (diff)
downloadhostap-608b0ff52a9533d067c30cead6ed881bd593e006.zip
hostap-608b0ff52a9533d067c30cead6ed881bd593e006.tar.gz
hostap-608b0ff52a9533d067c30cead6ed881bd593e006.tar.bz2
mesh: Check for initialization failures
It is possible that these location ended up getting called before mesh startup operations had been completed and that could result in dereferencing NULL pointers. Address those error cases by verifying that the needed parameters are available before using them. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/mesh_mpm.c')
-rw-r--r--wpa_supplicant/mesh_mpm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 2e5afd9..3b931f8 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -310,9 +310,14 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s,
wpabuf_put_le16(buf, sta->peer_lid);
if (type == PLINK_CLOSE)
wpabuf_put_le16(buf, close_reason);
- if (ampe)
+ if (ampe) {
+ if (sta->sae == NULL) {
+ wpa_msg(wpa_s, MSG_INFO, "Mesh MPM: no SAE session");
+ goto fail;
+ }
mesh_rsn_get_pmkid(wpa_s->mesh_rsn, sta,
wpabuf_put(buf, PMKID_LEN));
+ }
#ifdef CONFIG_IEEE80211N
if (type != PLINK_CLOSE &&