summaryrefslogtreecommitdiffstats
path: root/src/network.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-08-18 13:46:58 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-08-18 13:51:40 -0500
commitee0c621e5480009dd06dfd37150fb17d6a9e618b (patch)
tree8a2c643624071174333b03c80114de7d17276425 /src/network.c
parent75603a546f6472c71a0ad93a429c221d02619994 (diff)
downloadofono-ee0c621e5480009dd06dfd37150fb17d6a9e618b.tar.bz2
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
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c3
1 files changed, 3 insertions, 0 deletions
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);