summaryrefslogtreecommitdiffstats
path: root/src/stk.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-07-25 22:20:43 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-07-25 22:21:46 -0500
commit0c42430f2bccfed1c37b1cc760cc86f1f911e71b (patch)
tree89be27b918c4c578d8bd01714fe6766e1cdc8b48 /src/stk.c
parentf837bdc90a6e00ce61eb848bba2e586481f74ad4 (diff)
downloadofono-0c42430f2bccfed1c37b1cc760cc86f1f911e71b.tar.bz2
stk: Fix possible crash
We can't call stk_command_free on a NULL object
Diffstat (limited to 'src/stk.c')
-rw-r--r--src/stk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stk.c b/src/stk.c
index e85e595f..209c0bf6 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -2943,11 +2943,11 @@ void ofono_stk_proactive_command_handled_notify(struct ofono_stk *stk,
stk_proactive_command_cancel(stk);
stk->pending_cmd = stk_command_new_from_pdu(pdu, length);
+ if (stk->pending_cmd == NULL)
+ return;
- if (stk->pending_cmd == NULL ||
- stk->pending_cmd->status != STK_PARSE_RESULT_OK) {
- ofono_error("Can't parse proactive command");
-
+ if (stk->pending_cmd->status != STK_PARSE_RESULT_OK) {
+ ofono_error("Can't parse modem-handled proactive command");
ok = FALSE;
goto out;
}