fix prevent
authorChangseok Oh <seok.oh@samsung.com>
Sat, 13 Apr 2013 06:26:59 +0000 (15:26 +0900)
committerChangseok Oh <seok.oh@samsung.com>
Sat, 13 Apr 2013 06:26:59 +0000 (15:26 +0900)
plugin/mms_plugin/MmsPluginMessage.cpp
plugin/mms_plugin/MmsPluginStorage.cpp
plugin/sms_plugin/SmsPluginSatHandler.cpp

index 069552a..d4b6f98 100755 (executable)
@@ -441,7 +441,7 @@ MsgMultipart *MmsMakeMultipart(MimeType mimeType, char *szTitleName, char *szOrg
        MsgMultipart *pMultipart = NULL;
 
        if ((pMultipart = MmsAllocMultipart()) == NULL)
-               goto __CATCH;
+               return NULL;
 
        pMultipart->type.type = mimeType;
 
@@ -475,23 +475,6 @@ MsgMultipart *MmsMakeMultipart(MimeType mimeType, char *szTitleName, char *szOrg
                pMultipart->pBody->size = MsgGetFileSize(szOrgFilePath);
        }
        return pMultipart;
-
-__CATCH:
-
-       if (pMultipart) {
-               if (pMultipart->pBody) {
-                       if (pMultipart->pBody->body.pText) {
-                               free(pMultipart->pBody->body.pText);
-                               pMultipart->pBody->body.pText = NULL;
-                       }
-                       free(pMultipart->pBody);
-                       pMultipart->pBody = NULL;
-               }
-               free(pMultipart);
-               pMultipart = NULL;
-       }
-
-       return NULL;
 }
 
 bool MmsGetTypeByFileName(int *type, char *szFileName)
@@ -1309,7 +1292,7 @@ bool MmsMakeMmsData(MmsMsg *pMsg, MMS_MESSAGE_DATA_S *pMmsMsg)
 {
        MSG_BEGIN();
 
-       bzero(pMmsMsg, sizeof(pMmsMsg));
+       bzero(pMmsMsg, sizeof(MMS_MESSAGE_DATA_S));
        pMmsMsg->regionCnt = 0;
        pMmsMsg->pageCnt = 0;
        pMmsMsg->attachCnt = 0;
index f75115d..950896e 100755 (executable)
@@ -1429,7 +1429,7 @@ msg_error_t MmsPluginStorage::plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SEN
        unsigned int nSize = 0;
        bool bMultipartRelated = false;
 
-       bzero(pMmsMsg, sizeof(pMmsMsg));
+       bzero(pMmsMsg, sizeof(MMS_MESSAGE_DATA_S));
        pMmsMsg->regionCnt = 0;
        pMmsMsg->pageCnt = 0;
        pMmsMsg->attachCnt = 0;
@@ -1526,9 +1526,11 @@ msg_error_t MmsPluginStorage::plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SEN
        return err;
 
 FREE_CATCH:
+       /*
        if (bMultipartRelated) {
                MsgMmsReleaseMmsLists(pMmsMsg);
        }
+       */
 
 L_CATCH:
        MSG_DEBUG("MmsPlgUpdateMessage : Update MMS Message Failed");
index 8a933cf..44c33f1 100755 (executable)
@@ -169,7 +169,7 @@ void SmsPluginSatHandler::sendSms(void *pData)
        memset((void*)pkgInfo.szData, 0x00, sizeof(pkgInfo.szData));
        memcpy((void*)pkgInfo.szData, tpdu, tpduLen);
 
-       pkgInfo.szData[tpduLen] = '\0';
+       pkgInfo.szData[tpduLen - 1] = '\0';
        pkgInfo.MsgLength = tpduLen;
 
        // Set SMSC Address