From ee0c621e5480009dd06dfd37150fb17d6a9e618b Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 18 Aug 2011 13:46:58 -0500 Subject: network: Fix crash with an empty mcc/mnc cops list Some hardware returns an empty mcc/mnc operator during an operator scan when no operators are found (e.g. on an LTE dongle in a non-LTE area). This results in oFono mistaking trying to update a non-existent operator object. For reference: ofonod[27532]: Device: < \r\n+NWSTATEIND: 4\r\n\r\n+COPS: (0,"","","",255),,(0-4),(0-2)\r\n\r \nOK\r\n process 27532: arguments to dbus_message_new_signal() were incorrect, assertion "_dbus_check_ is_valid_path (path)" failed in file dbus-message.c line 1289. This is normally a bug in some application using the D-Bus library. D-Bus not built with -rdynamic so unable to print a backtrace --- src/network.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/network.c') diff --git a/src/network.c b/src/network.c index 897e1fef..9becefb5 100644 --- a/src/network.c +++ b/src/network.c @@ -689,6 +689,9 @@ static GSList *compress_operator_list(const struct ofono_network_operator *list, for (i = 0; i < total; i++) { o = NULL; + if (list[i].mcc[0] == '\0' || list[i].mnc[0] == '\0') + continue; + if (oplist) o = g_slist_find_custom(oplist, &list[i], network_operator_compare); -- cgit v1.2.3