From: sinikang Date: Thu, 27 Apr 2017 06:13:56 +0000 (+0900) Subject: Add Invalid SIM SLOT handling X-Git-Tag: submit/tizen/20170427.063133^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd64684fbd53d142dbc3a10654985ce3bc0f3e59;p=platform%2Fcore%2Ftelephony%2Ftel-plugin-syspopup.git Add Invalid SIM SLOT handling Change-Id: I543da083c1baffdd777e5c510efb1f9a3e8eb9a2 --- diff --git a/packaging/tel-plugin-syspopup.spec b/packaging/tel-plugin-syspopup.spec index e9b87b0..9c90597 100644 --- a/packaging/tel-plugin-syspopup.spec +++ b/packaging/tel-plugin-syspopup.spec @@ -1,6 +1,6 @@ %define major 0 %define minor 1 -%define patchlevel 5 +%define patchlevel 6 Name: tel-plugin-syspopup Version: %{major}.%{minor}.%{patchlevel} diff --git a/src/notifier.c b/src/notifier.c index 261fcd0..1b8b508 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -318,6 +318,11 @@ static void _handle_prop_net_manual_selection_status(TcorePlugin *p, CoreObject } id = __get_sim_slotid(co); + if (id == SLOT_ID_MAX) { + err("Invalid SIM SLOT ID"); + return; + } + value = tcore_object_ref_property(co, PROP_NET_MANUAL_SELECTION_STATUS); info("slot(%d), manual selection status = %s", id, value); @@ -349,6 +354,11 @@ static void _handle_prop_net_manual_plmn(TcorePlugin *p, CoreObject *co) } id = __get_sim_slotid(co); + if (id == SLOT_ID_MAX) { + err("Invalid SIM SLOT ID"); + return; + } + manual_plmn = tcore_object_ref_property(co, PROP_NET_MANUAL_PLMN); dbg("property changed (value = %s) for slot(%d)", (manual_plmn ? manual_plmn : "Null"), id); @@ -491,6 +501,10 @@ static enum tcore_hook_return on_hook_network_service_type_change(Server *s, Cor } id = __get_sim_slotid(source); + if (id == SLOT_ID_MAX) { + err("Invalid SIM SLOT ID"); + return TCORE_HOOK_RETURN_CONTINUE; + } if (ud->sim_status[id] == SIM_STATUS_CARD_NOT_PRESENT || ud->sim_status[id] == SIM_STATUS_UNKNOWN) { dbg("No SIM or Unknown"); @@ -574,6 +588,11 @@ static enum tcore_hook_return on_hook_sim_status(Server *s, CoreObject *source, } id = __get_sim_slotid(source); + if (id == SLOT_ID_MAX) { + err("Invalid SIM SLOT ID"); + return TCORE_HOOK_RETURN_CONTINUE; + } + ud->sim_status[id] = sim->sim_status; dbg("slot:[%d] sim_status : [0x%x]", id, ud->sim_status[id]); diff --git a/src/notifier_preferred_voice.c b/src/notifier_preferred_voice.c index 51c467c..3449fa9 100644 --- a/src/notifier_preferred_voice.c +++ b/src/notifier_preferred_voice.c @@ -58,6 +58,11 @@ static enum tcore_hook_return on_hook_sim_status(Server *s, modem_plugin = tcore_object_ref_plugin(source); slot_id = __get_sim_slotid(source); + if (slot_id == SLOT_ID_MAX) { + err("Invalid SIM SLOT ID"); + return TCORE_HOOK_RETURN_CONTINUE; + } + other_slot_id = (slot_id == SLOT_ID_PRIMARY) ? SLOT_ID_SECONDARY : SLOT_ID_PRIMARY; sim_status = ud->sim_status[slot_id] = sim->sim_status;