summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2010-08-20 04:07:09 +0200
committerDenis Kenzior <denkenz@gmail.com>2010-08-20 09:02:29 -0500
commitb6488dec417f18ff0185ee1b25a408114a97c635 (patch)
tree4e0ba279e69038be1c2ee161e2f384f045b3c183 /src
parentbe4b597ec87bb61ed4703eec81eba532274216e5 (diff)
downloadofono-b6488dec417f18ff0185ee1b25a408114a97c635.tar.bz2
stk: reorder: Don't access freed memory in Send SMS
Responding to the stk->pending_cmd frees it, we need to read it before that.
Diffstat (limited to 'src')
-rw-r--r--src/stk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stk.c b/src/stk.c
index dd9f4533..a7e594eb 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,