From 922f4a30dd58a27d3fa5b033e718f545fe1f3b35 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Thu, 2 May 2019 12:55:18 +0200 Subject: [PATCH] netdev: Check connected when handling Associate An unexpected Associate event would cause iwd to crash when accessing netdev->handshake->mde. netdev->handshake is only set if we're attempting to connect or connected somewhere so check netdev->connected first. --- src/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netdev.c b/src/netdev.c index f0e6d828..b8f7e258 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -2434,7 +2434,7 @@ static void netdev_associate_event(struct l_genl_msg *msg, l_debug(""); - if (netdev->aborting) + if (!netdev->connected || netdev->aborting) return; if (!netdev->owe && !netdev->in_ft && !netdev->handshake->mde &&