Fix telephony crash when SIM has invalid message 51/8451/1
authorwootak.jung <wootak.jung@samsung.com>
Tue, 30 Jul 2013 05:08:54 +0000 (14:08 +0900)
committerwootak.jung <wootak.jung@samsung.com>
Tue, 20 Aug 2013 00:28:18 +0000 (09:28 +0900)
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
src/s_sms.c

index 281d812..2db1d33 100644 (file)
@@ -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
index 5b5ca30..f47d0b2 100644 (file)
@@ -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);