diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-02-10 15:53:29 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-02-10 15:54:14 +0100 |
commit | cf33699115ff48f9cbf70f45585d1b1df9946650 (patch) | |
tree | 33b9417e84f54c3770ce6dd699ea0363a269c3e6 /plugins | |
parent | 4bd503c8218bdc278ca432f5fad34654de0cbc44 (diff) | |
download | connman-cf33699115ff48f9cbf70f45585d1b1df9946650.tar.gz |
ofono: Check for mcc before using it as an index
Also avoid calling set_regdom is the alpha2 is NULL.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ofono.c | 5 |
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, |