fix SMSP record length error 42/8442/1
authorCaiwen Zhang <caiwen.zhang@intel.com>
Sat, 8 Jun 2013 20:03:19 +0000 (04:03 +0800)
committerwootak.jung <wootak.jung@samsung.com>
Tue, 20 Aug 2013 00:28:17 +0000 (09:28 +0900)
Change-Id: Ib925e094da8bead33cfa5c55543dd4e94b0fcb6b

src/s_sms.c

index c13f280..5b5ca30 100644 (file)
@@ -2980,6 +2980,7 @@ static TReturn set_sms_params(CoreObject *obj, UserRequest *ur)
        char *encoded_data = NULL;
        unsigned char *temp_data = NULL;
        int SMSPRecordLen = 0;
+       int *smsp_record_len;
 
        TcoreHal *hal = NULL;
        TcoreATRequest *atreq = NULL;
@@ -3002,7 +3003,11 @@ static TReturn set_sms_params(CoreObject *obj, UserRequest *ur)
        }
 
        //EFsmsp file size is 28 +Y bytes (Y is alpha id size)
-       SMSPRecordLen = 28 + setSmsParams->params.alphaIdLen;
+       smsp_record_len = tcore_plugin_ref_property(tcore_object_ref_plugin(obj), "SMSPRECORDLEN");
+       SMSPRecordLen = *smsp_record_len;
+       if (SMSPRecordLen < nDefaultSMSPWithoutAlphaId)
+               return FALSE;
+
        temp_data = calloc(SMSPRecordLen,1);
        encoded_data = calloc(SMSPRecordLen*2 + 1,1);