All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stk: reorder: Don't access freed memory in Send SMS
@ 2010-08-20  2:07 Andrzej Zaborowski
  2010-08-20 14:04 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Zaborowski @ 2010-08-20  2:07 UTC (permalink / raw)
  To: ofono

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

Responding to the stk->pending_cmd frees it, we need to read it
before that.
---
 src/stk.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index ce71075..f391396 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -695,6 +695,10 @@ static void send_sms_submit_cb(gboolean ok, void *data)
 		return;
 	}
 
+	if (stk->pending_cmd->send_sms.alpha_id &&
+			stk->pending_cmd->send_sms.alpha_id[0])
+		stk_alpha_id_unset(stk);
+
 	memset(&rsp, 0, sizeof(rsp));
 
 	if (ok == FALSE)
@@ -702,10 +706,6 @@ static void send_sms_submit_cb(gboolean ok, void *data)
 
 	if (stk_respond(stk, &rsp, stk_command_cb))
 		stk_command_cb(&failure, stk);
-
-	if (stk->pending_cmd->send_sms.alpha_id &&
-			stk->pending_cmd->send_sms.alpha_id[0])
-		stk_alpha_id_unset(stk);
 }
 
 static gboolean handle_command_send_sms(const struct stk_command *cmd,
-- 
1.7.1.86.g0e460.dirty


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

* Re: [PATCH] stk: reorder: Don't access freed memory in Send SMS
  2010-08-20  2:07 [PATCH] stk: reorder: Don't access freed memory in Send SMS Andrzej Zaborowski
@ 2010-08-20 14:04 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2010-08-20 14:04 UTC (permalink / raw)
  To: ofono

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

Hi Andrew,

On 08/19/2010 09:07 PM, Andrzej Zaborowski wrote:
> Responding to the stk->pending_cmd frees it, we need to read it
> before that.
> ---

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2010-08-20 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-20  2:07 [PATCH] stk: reorder: Don't access freed memory in Send SMS Andrzej Zaborowski
2010-08-20 14:04 ` 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.