From 2b15150e02f1caa6f195c3201e2faa9d7f0122d5 Mon Sep 17 00:00:00 2001 From: Sangkoo Kim Date: Wed, 23 Oct 2013 20:32:34 +0900 Subject: [PATCH] Fix prevent issue. Change-Id: I4d46c6a843a90cc076ed1380027c29a356f9367e --- framework/storage-handler/MsgStorageManager.cpp | 3 ++- framework/storage-handler/MsgStorageMessage.cpp | 4 ++-- plugin/sms_plugin/SmsPluginWapPushHandler.cpp | 2 +- utils/MsgDrmWrapper.cpp | 2 +- vobject-engine/VCard.c | 9 +++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/framework/storage-handler/MsgStorageManager.cpp b/framework/storage-handler/MsgStorageManager.cpp index f5837d1..72d4c83 100755 --- a/framework/storage-handler/MsgStorageManager.cpp +++ b/framework/storage-handler/MsgStorageManager.cpp @@ -924,7 +924,8 @@ msg_error_t MsgStoUpdateMms(MSG_MESSAGE_INFO_S *pMsg) dbHandle.finalizeQuery(); dbHandle.endTrans(true); } else { - MsgStoUpdateMMSMessage(pMsg); + if (MsgStoUpdateMMSMessage(pMsg) != MSG_SUCCESS) + MSG_DEBUG("MsgStoUpdateMMSMessage is failed"); } return MSG_SUCCESS; } diff --git a/framework/storage-handler/MsgStorageMessage.cpp b/framework/storage-handler/MsgStorageMessage.cpp index c9dc0b8..834ce08 100755 --- a/framework/storage-handler/MsgStorageMessage.cpp +++ b/framework/storage-handler/MsgStorageMessage.cpp @@ -674,8 +674,8 @@ msg_error_t MsgStoDeleteMessage(msg_message_id_t msgId, bool bCheckIndication) } } else if (msgType.mainType == MSG_MMS_TYPE) { - char filePath[MSG_FILEPATH_LEN_MAX] = {0,}; - char dirPath[MSG_FILEPATH_LEN_MAX]= {0,}; + char filePath[MSG_FILEPATH_LEN_MAX+1] = {0,}; + char dirPath[MSG_FILEPATH_LEN_MAX+1]= {0,}; memset(sqlQuery, 0x00, sizeof(sqlQuery)); snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE MSG_ID = %d;", diff --git a/plugin/sms_plugin/SmsPluginWapPushHandler.cpp b/plugin/sms_plugin/SmsPluginWapPushHandler.cpp index 5bffa64..3596afa 100755 --- a/plugin/sms_plugin/SmsPluginWapPushHandler.cpp +++ b/plugin/sms_plugin/SmsPluginWapPushHandler.cpp @@ -3179,7 +3179,7 @@ void SmsPluginWapPushHandler::wspHeaderDecodeDateValue( unsigned long length, un /* check date value validity */ { - if (( pTMData->tm_wday > 6 ) || (pTMData->tm_mon > 12 ) || (pTMData->tm_mday > 31 )) + if (( pTMData->tm_wday > 6 ) || (pTMData->tm_mon > 11 ) || (pTMData->tm_mday > 31 )) { MSG_DEBUG( "WspLHeaderDecodeDateValue: Date decode fail %d, %d, %d \n", pTMData->tm_wday, pTMData->tm_mon, pTMData->tm_mday ); strncpy( (char*)*pDecodedString, "Decoding Failed", WSP_STANDARD_STR_LEN_MAX-1); diff --git a/utils/MsgDrmWrapper.cpp b/utils/MsgDrmWrapper.cpp index 7c3c572..48114ac 100755 --- a/utils/MsgDrmWrapper.cpp +++ b/utils/MsgDrmWrapper.cpp @@ -189,7 +189,7 @@ bool MsgDrmGetContentID(const char *szFileName, char *szContentID, int nContentI char strTemp[MSG_MAX_DRM_FILE_PATH + 1] = {0,}; - strncpy(strTemp, szFileName, sizeof(strTemp)); + strncpy(strTemp, szFileName, MSG_MAX_DRM_FILE_PATH); drm_content_info_s content_info; memset(&content_info, 0x00, sizeof(drm_content_info_s)); diff --git a/vobject-engine/VCard.c b/vobject-engine/VCard.c index d6cab9d..a6f1892 100755 --- a/vobject-engine/VCard.c +++ b/vobject-engine/VCard.c @@ -600,10 +600,10 @@ __VCardGetParamVal( char* pVCardRaw, int* pStatus, int* pDLen ) pBuf = (char *)malloc(len); if(len < 1 || (pBuf == NULL)) { - if (pBuf) { - free(pBuf); - pBuf = NULL; - } +// if (pBuf) { +// free(pBuf); +// pBuf = NULL; +// } return NULL; } @@ -904,6 +904,7 @@ vcard_decode( char *pCardRaw ) if(start_status == 1) { goto CATCH; } + if ( ( pVCard = ( VTree* )malloc( sizeof( VTree ) ) ) == NULL ) { start_status = 1; goto CATCH; -- 2.7.4