All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stk: Add null pointer check
@ 2011-02-25 10:39 Lasse Kunnasluoto
  2011-02-25 12:39 ` Andrzej Zaborowski
  0 siblings, 1 reply; 6+ messages in thread
From: Lasse Kunnasluoto @ 2011-02-25 10:39 UTC (permalink / raw)
  To: ofono

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

Fixes a crash when SIM Session End is received while waiting for user response to SELECT ITEM command.
---
 src/stk.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index bc46b2f..cda378f 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -115,6 +115,9 @@ static int stk_respond(struct ofono_stk *stk, struct stk_response *rsp,
 	if (stk->driver->terminal_response == NULL)
 		return -ENOSYS;
 
+	if (stk->pending_cmd == NULL)
+		return -EINVAL;
+
 	rsp->src = STK_DEVICE_IDENTITY_TYPE_TERMINAL;
 	rsp->dst = STK_DEVICE_IDENTITY_TYPE_UICC;
 	rsp->number = stk->pending_cmd->number;
-- 
1.7.0.4


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

end of thread, other threads:[~2011-02-28  9:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 10:39 [PATCH] stk: Add null pointer check Lasse Kunnasluoto
2011-02-25 12:39 ` Andrzej Zaborowski
2011-02-25 13:04   ` Lasse Kunnasluoto
2011-02-25 13:28     ` Andrzej Zaborowski
2011-02-25 17:58       ` Denis Kenzior
2011-02-28  9:50         ` Lasse Kunnasluoto

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.