From f8be045b5f95fc5647f33fc36ff7b196de9799e2 Mon Sep 17 00:00:00 2001 From: "wootak.jung" Date: Tue, 30 Jul 2013 14:08:54 +0900 Subject: [PATCH] Fix telephony crash when SIM has invalid message We don't need to read the message if SCA is invalid on message stored in SIM Change-Id: I9d6d4a9c103e1eca6675a7310fc735bd913bcd3e --- packaging/tel-plugin-imc.spec | 2 +- src/s_sms.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packaging/tel-plugin-imc.spec b/packaging/tel-plugin-imc.spec index 281d812..2db1d33 100644 --- a/packaging/tel-plugin-imc.spec +++ b/packaging/tel-plugin-imc.spec @@ -1,7 +1,7 @@ #sbs-git:slp/pkgs/t/tel-plugin-imc Name: tel-plugin-imc Summary: imc plugin for telephony -Version: 0.1.41 +Version: 0.1.42 Release: 1 Group: Development/Libraries License: Apache diff --git a/src/s_sms.c b/src/s_sms.c index 5b5ca30..f47d0b2 100644 --- a/src/s_sms.c +++ b/src/s_sms.c @@ -898,6 +898,9 @@ static void on_response_read_msg(TcorePending *pending, int data_len, const void dbg("Invalid Message Length"); resp_read_msg.result = SMS_INVALID_PARAMETER_FORMAT; } + } else if (sca_length > SMS_ENCODED_SCA_LEN_MAX) { + dbg("Invalid Message Length"); + resp_read_msg.result = SMS_INVALID_PARAMETER_FORMAT; } else { if ((resp_read_msg.dataInfo.smsData.msgLength > 0) && (resp_read_msg.dataInfo.smsData.msgLength <= SMS_SMDATA_SIZE_MAX)) { @@ -2237,7 +2240,7 @@ static TReturn read_msg(CoreObject *obj, UserRequest *ur) } dbg("index: [%d]", readMsg->index); - cmd_str = g_strdup_printf("AT+CMGR=%d", (readMsg->index + 1)); //IMC index is one ahead of TAPI + cmd_str = g_strdup_printf("AT+CMGR=%d", readMsg->index); //IMC index is one ahead of TAPI atreq = tcore_at_request_new((const char *)cmd_str, "+CMGR", TCORE_AT_PDU); pending = tcore_pending_new(obj, 0); -- 2.7.4