mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
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>
This commit is contained in:
parent
f029c44cf2
commit
a5d2bf2473
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user