From 6058c800df1d1cedeed2410cbf42c2776e1555a2 Mon Sep 17 00:00:00 2001 From: Guillaume Lucas Date: Wed, 8 Dec 2010 12:33:32 +0000 Subject: 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. --- src/stk.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') 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, -- cgit v1.2.3