path: root/plugins/ofono.c
diff options
authorDaniel Wagner <>2012-03-30 16:16:55 +0200
committerDaniel Wagner <>2012-04-02 14:52:01 +0200
commit17c6e7cee47f0d22e311592ab3037cbc71885cb4 (patch)
treec65b8346cef8ca503a18fa6dafad160e09b76e24 /plugins/ofono.c
parente9193626202ed4b13586eaf0f422e0c9079fe9ce (diff)
ofono: Fix NULL pointer access in set_disconnect()
oFono sends several ConnectionContext.PropertyChanged("Active", False) after it was told to disconnect. After studying the oFono part, it looks like that serveral CREGS updates could trigger oFono to send us the same flag over and over again (see ofono_gprs_status_notify()). Even though oFono might missbehave, ConnMan should not crash so easily. Luckely, the fix is very simple. We should just check if we still have a valid network pointer before accessing it. Fixes BMC#25026
Diffstat (limited to 'plugins/ofono.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 74c12d88..754ff6eb 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -312,6 +312,9 @@ static void set_disconnected(struct modem_data *modem)
DBG("%s", modem->path);
+ if (modem->network == NULL)
+ return;
connman_network_set_connected(modem->network, FALSE);