diff options
author | Guillaume Lucas <guillaumex.lucas@intel.com> | 2010-12-08 12:33:32 +0000 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-12-10 11:18:06 -0600 |
commit | 6058c800df1d1cedeed2410cbf42c2776e1555a2 (patch) | |
tree | 5d01bafa3ef2d6a333d9ad12bc7bb1d95cf99c41 /src/stk.c | |
parent | b148996a54b9a6410f5c464a818be1ec0c012dd2 (diff) | |
download | ofono-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.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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, |