From e98f68330944f18202533222fbae9ae4a3c6cbec Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 11 Sep 2017 02:25:42 +0200 Subject: [PATCH] network.c: notify_status_watches: check for NULL In rare cases when ofono_netreg_status_notify() is called before ofono_netreg_register() netreg->status_watches is NULL. --- src/network.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network.c b/src/network.c index a3d41a74..6e69b078 100644 --- a/src/network.c +++ b/src/network.c @@ -1186,6 +1186,9 @@ static void notify_status_watches(struct ofono_netreg *netreg) const char *mcc = NULL; const char *mnc = NULL; + if (netreg->status_watches == NULL) + return; + if (netreg->current_operator) { mcc = netreg->current_operator->mcc; mnc = netreg->current_operator->mnc;