summaryrefslogtreecommitdiffstats
path: root/src/stk.c
diff options
context:
space:
mode:
authorPhilippe Nunes <philippe.nunes@linux.intel.com>2012-08-30 18:20:41 +0200
committerDenis Kenzior <denkenz@gmail.com>2012-08-30 16:47:20 -0500
commit3ac780fee7162a2d7ad42070f92da1dddfa57c18 (patch)
tree6af40a506887be7cc26522a073e86e6050b9889b /src/stk.c
parentec6269e59b45ee6efe1dfdc345ed1d3b135b82db (diff)
downloadofono-3ac780fee7162a2d7ad42070f92da1dddfa57c18.tar.bz2
stk: Check if an agent is registered when UI is required
In case of unsolicited proactive command, we could have a crash when no agent was registered.
Diffstat (limited to 'src/stk.c')
-rw-r--r--src/stk.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/stk.c b/src/stk.c
index b4714467..05565e0b 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -515,6 +515,9 @@ static gboolean stk_alpha_id_set(struct ofono_stk *stk,
if (alpha == NULL)
return FALSE;
+ if (stk->current_agent == NULL)
+ return FALSE;
+
if (stk->respond_on_exit)
stk_agent_display_action(stk->current_agent, alpha, icon,
user_termination_cb, stk, NULL);
@@ -2640,6 +2643,9 @@ static gboolean handle_setup_call_confirmation_req(struct stk_command *cmd,
if (alpha_id == NULL)
goto out;
+ if (stk->current_agent == FALSE)
+ goto out;
+
err = stk_agent_confirm_call(stk->current_agent, alpha_id,
&sc->icon_id_usr_cfm,
confirm_handled_call_cb,
@@ -2747,6 +2753,9 @@ void ofono_stk_proactive_command_notify(struct ofono_stk *stk,
case STK_COMMAND_TYPE_GET_INPUT:
case STK_COMMAND_TYPE_PLAY_TONE:
case STK_COMMAND_TYPE_SETUP_CALL:
+ case STK_COMMAND_TYPE_SEND_SMS:
+ case STK_COMMAND_TYPE_SEND_USSD:
+ case STK_COMMAND_TYPE_SEND_DTMF:
send_simple_response(stk, STK_RESULT_TYPE_NOT_CAPABLE);
return;