summaryrefslogtreecommitdiffstats
path: root/src/stk.c
diff options
context:
space:
mode:
authorGuillaume Lucas <guillaumex.lucas@intel.com>2010-12-08 12:33:32 +0000
committerDenis Kenzior <denkenz@gmail.com>2010-12-10 11:18:06 -0600
commit6058c800df1d1cedeed2410cbf42c2776e1555a2 (patch)
tree5d01bafa3ef2d6a333d9ad12bc7bb1d95cf99c41 /src/stk.c
parentb148996a54b9a6410f5c464a818be1ec0c012dd2 (diff)
downloadofono-6058c800df1d1cedeed2410cbf42c2776e1555a2.tar.bz2
stk: fix issue to avoid null pointer for alpha_id
If a SET UP CALL proactive command with no alpha identifier occurs, the alpha_id pointer will be set to NULL. This will generate a crash in the stkagent with dbus function. To avoid this we use an empty string if the alpha identifier is not present in the command.
Diffstat (limited to 'src/stk.c')
-rw-r--r--src/stk.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/stk.c b/src/stk.c
index 09229cea..87208d17 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1753,13 +1753,12 @@ static gboolean handle_command_set_up_call(const struct stk_command *cmd,
return TRUE;
}
- if (sc->alpha_id_usr_cfm) {
- alpha_id = dbus_apply_text_attributes(sc->alpha_id_usr_cfm,
- &sc->text_attr_usr_cfm);
- if (alpha_id == NULL) {
- rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
- return TRUE;
- }
+ alpha_id = dbus_apply_text_attributes(sc->alpha_id_usr_cfm ?
+ sc->alpha_id_usr_cfm : "",
+ &sc->text_attr_usr_cfm);
+ if (alpha_id == NULL) {
+ rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
+ return TRUE;
}
err = stk_agent_confirm_call(stk->current_agent, alpha_id,