From 0c42430f2bccfed1c37b1cc760cc86f1f911e71b Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 25 Jul 2011 22:20:43 -0500 Subject: stk: Fix possible crash We can't call stk_command_free on a NULL object --- src/stk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/stk.c') 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; } -- cgit v1.2.3