summaryrefslogtreecommitdiff
path: root/plugins/ofono.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-02-10 15:53:29 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2012-02-10 15:54:14 +0100
commitcf33699115ff48f9cbf70f45585d1b1df9946650 (patch)
tree33b9417e84f54c3770ce6dd699ea0363a269c3e6 /plugins/ofono.c
parent4bd503c8218bdc278ca432f5fad34654de0cbc44 (diff)
downloadconnman-cf33699115ff48f9cbf70f45585d1b1df9946650.tar.gz
connman-cf33699115ff48f9cbf70f45585d1b1df9946650.tar.bz2
connman-cf33699115ff48f9cbf70f45585d1b1df9946650.zip
ofono: Check for mcc before using it as an index
Also avoid calling set_regdom is the alpha2 is NULL.
Diffstat (limited to 'plugins/ofono.c')
-rw-r--r--plugins/ofono.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 0a77a6f1..df2b5807 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1415,11 +1415,12 @@ static void netreg_update_regdom(struct modem_data *modem,
mcc = atoi(mobile_country_code);
- if (mcc > 799)
+ if (mcc > 799 || mcc < 200)
return;
alpha2 = mcc_country_codes[mcc - 200];
- connman_technology_set_regdom(alpha2);
+ if (alpha2 != NULL)
+ connman_technology_set_regdom(alpha2);
}
static gboolean netreg_changed(DBusConnection *connection, DBusMessage *message,