summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2010-07-09 23:45:24 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-07-09 23:45:24 +0200
commitc612916ff8e071c4cf2c7bd70b2c7ead7aeff3d2 (patch)
tree174450e6640202498a4f8e0b9555e7cefbecad09
parenta0a70f029190cce180e811b8b307ff3ccf4a7652 (diff)
downloadconnman-c612916ff8e071c4cf2c7bd70b2c7ead7aeff3d2.tar.gz
connman-c612916ff8e071c4cf2c7bd70b2c7ead7aeff3d2.tar.bz2
connman-c612916ff8e071c4cf2c7bd70b2c7ead7aeff3d2.zip
Fix SEGV at first startup
connman_wifi_load_ssid() can return NULL. Best not to dereference that. This fixes Meego's bug #3787.
-rw-r--r--plugins/supplicant.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/supplicant.c b/plugins/supplicant.c
index 276fd913..85016bae 100644
--- a/plugins/supplicant.c
+++ b/plugins/supplicant.c
@@ -610,7 +610,13 @@ static void add_interface_reply(DBusPendingCall *call, void *user_data)
connman_device_set_powered(task->device, TRUE);
+ dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
+
hex_ssids = connman_wifi_load_ssid();
+ if (hex_ssids == NULL)
+ return;
for (i = 0; hex_ssids[i]; i++) {
unsigned char *ssid;
@@ -635,10 +641,6 @@ static void add_interface_reply(DBusPendingCall *call, void *user_data)
g_strfreev(hex_ssids);
- dbus_message_unref(reply);
-
- dbus_pending_call_unref(call);
-
return;
failed: