From: wootak.jung Date: Tue, 30 Jul 2013 05:08:54 +0000 (+0900) Subject: Fix telephony crash when SIM has invalid message X-Git-Tag: accepted/tizen/20131007.095414~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F8451%2F1;p=platform%2Fcore%2Ftelephony%2Ftel-plugin-imc.git 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 --- 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);