All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stk: fix issue to avoid null pointer for alpha_id
@ 2010-12-08 12:33 Lucas, GuillaumeX
  2010-12-10 17:18 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas, GuillaumeX @ 2010-12-08 12:33 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]

From: Guillaume Lucas <guillaumex.lucas@intel.com>

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 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index 7b39f7e..8c7cb8a 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1755,13 +1755,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,
-- 
1.7.0.4

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-10 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-08 12:33 [PATCH] stk: fix issue to avoid null pointer for alpha_id Lucas, GuillaumeX
2010-12-10 17:18 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.