aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mesh_rsn.c
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2015-08-26 08:32:38 (GMT)
committerJouni Malinen <j@w1.fi>2015-09-05 18:31:25 (GMT)
commita5d2bf247300fe35ff1d6e971116d9c8e6b8a87f (patch)
treed1804ea43921a4ec820d7047627d7ff710ae00b1 /wpa_supplicant/mesh_rsn.c
parentf029c44cf29c97d408eb15bad28137505862d95b (diff)
downloadhostap-a5d2bf247300fe35ff1d6e971116d9c8e6b8a87f.zip
hostap-a5d2bf247300fe35ff1d6e971116d9c8e6b8a87f.tar.gz
hostap-a5d2bf247300fe35ff1d6e971116d9c8e6b8a87f.tar.bz2
mesh: Fix segfault on error path
When wpa_init() in __mesh_rsn_auth_init() failed, empty rsn->auth caused segmentation fault due to NULL pointer dereference when wpa_deinit() was called. Fix this by checking the pointer before executing deinit steps. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant/mesh_rsn.c')
-rw-r--r--wpa_supplicant/mesh_rsn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c
index a140b97..9dce32f 100644
--- a/wpa_supplicant/mesh_rsn.c
+++ b/wpa_supplicant/mesh_rsn.c
@@ -190,7 +190,8 @@ static int __mesh_rsn_auth_init(struct mesh_rsn *rsn, const u8 *addr)
static void mesh_rsn_deinit(struct mesh_rsn *rsn)
{
os_memset(rsn->mgtk, 0, sizeof(rsn->mgtk));
- wpa_deinit(rsn->auth);
+ if (rsn->auth)
+ wpa_deinit(rsn->auth);
}