diff options
author | Denis Kenzior <denkenz@gmail.com> | 2011-07-25 22:20:43 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-07-25 22:21:46 -0500 |
commit | 0c42430f2bccfed1c37b1cc760cc86f1f911e71b (patch) | |
tree | 89be27b918c4c578d8bd01714fe6766e1cdc8b48 /src/stk.c | |
parent | f837bdc90a6e00ce61eb848bba2e586481f74ad4 (diff) | |
download | ofono-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; } |