Got a segmentation fault in the middle of a group
configuration, where the pending p2p-wlan was no
more available. This check actually comes ahead of
another one in interface_added.
---
 plugins/wifi.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 861304b..f741bec 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -178,9 +178,14 @@ static struct wifi_data *get_pending_wifi_data(const char 
*ifname)
        GList *list;
 
        for (list = pending_wifi_device; list; list = list->next) {
-               struct wifi_data *wifi = list->data;
-               const char *dev_name = connman_device_get_string(wifi->device,
-                                                               "Interface");
+               struct wifi_data *wifi;
+               const char *dev_name;
+
+               wifi = list->data;
+               if (!wifi)
+                       continue;
+
+               dev_name = connman_device_get_string(wifi->device, "Interface");
                if (!g_strcmp0(ifname, dev_name)) {
                        pending_wifi_device = g_list_delete_link(
                                                pending_wifi_device, list);
-- 
1.9.1

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to