From 337ceef5fc556f72ddd8729f01a92085ef8a5b52 Mon Sep 17 00:00:00 2001 From: Abhimanyu Swami Date: Mon, 15 Feb 2021 08:37:50 +0000 Subject: [PATCH] Revert "SVACE issue fix" This reverts commit 2ecadb061a7cd75bd15aad72e349297625f76a58. Problem with TC. Will resubmit after resolving. Change-Id: I0615d5bf63cc283f619d97e4eef0eb49ba190952 --- framework/storage-handler/MsgStorageFolder.cpp | 5 ----- plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp | 10 ++-------- utils/MsgUtilStorage.cpp | 21 --------------------- utils/MsgVMessage.cpp | 2 -- 4 files changed, 2 insertions(+), 36 deletions(-) diff --git a/framework/storage-handler/MsgStorageFolder.cpp b/framework/storage-handler/MsgStorageFolder.cpp index bf12ef3..1688fec 100755 --- a/framework/storage-handler/MsgStorageFolder.cpp +++ b/framework/storage-handler/MsgStorageFolder.cpp @@ -133,11 +133,6 @@ msg_error_t MsgStoGetFolderList(msg_struct_list_s *pFolderList) pFolderList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(MSG_FOLDER_INFO_S *)); - if (pFolderList->msg_struct_info == NULL){ - dbHandle->freeTable(); - return MSG_ERR_NULL_POINTER; - } - msg_struct_s* pTmp = NULL; for (int i = 0; i < rowCnt; i++) { diff --git a/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp b/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp index c00684c..7ac659f 100755 --- a/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp +++ b/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp @@ -2070,20 +2070,15 @@ int Sms3gpp2MsgCodec::decodeAbsTime(const unsigned char *p_pkg_str, sms_3gpp2_ti int Sms3gpp2MsgCodec::encodeUserData(const unsigned char* src, unsigned char *dest, int src_size) { - int i, j = 0; + int i, j; int shift = 0; unsigned char *tmp = (unsigned char *)calloc(1, src_size+1); - - if (tmp == NULL){ - MSG_ERR("failed to allocate memory"); - goto END; - } - for (i = 0; i < src_size; i++) { tmp[i] = src[i] << 1; } + j = 0; for (i = 0; i < src_size; i++) { shift = j % 7; dest[j++] = (tmp[i] << shift) + (tmp[i+1] >> (7-shift)); @@ -2097,7 +2092,6 @@ int Sms3gpp2MsgCodec::encodeUserData(const unsigned char* src, unsigned char *de tmp = NULL; } -END: return j; } diff --git a/utils/MsgUtilStorage.cpp b/utils/MsgUtilStorage.cpp index 1ac8b23..04d6d76 100755 --- a/utils/MsgUtilStorage.cpp +++ b/utils/MsgUtilStorage.cpp @@ -654,11 +654,6 @@ msg_error_t MsgStoGetAddressByConvId(MsgDbHandler *pDbHandle, msg_thread_id_t co pAddrlist->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(msg_struct_t)); - if (pAddrlist->msg_struct_info == NULL){ - pDbHandle->freeTable(); - return MSG_ERR_NULL_POINTER; - } - for (int i = 0; i < rowCnt; i++) { pAddrlist->msg_struct_info[i] = (msg_struct_t)new msg_struct_s; pTmp = (msg_struct_s *)pAddrlist->msg_struct_info[i]; @@ -1758,11 +1753,6 @@ msg_error_t MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct pThreadViewList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(msg_struct_t)); - if (pThreadViewList->msg_struct_info == NULL){ - dbHandle->freeTable(); - return MSG_ERR_NULL_POINTER; - } - MSG_THREAD_VIEW_S *pTmp = NULL; msg_struct_s *thread_t = NULL; @@ -2230,12 +2220,6 @@ msg_error_t MsgStoGetConversationViewList(msg_thread_id_t threadId, msg_struct_l MSG_DEBUG("pConvViewList->nCount [%d]", pConvViewList->nCount); pConvViewList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(msg_struct_t)); - - if (pConvViewList->msg_struct_info = NULL){ - dbHandle->freeTable(); - return MSG_ERR_NULL_POINTER; - } - memset(pConvViewList->msg_struct_info, 0x00, sizeof(msg_struct_t) * rowCnt); msg_struct_s *conv = NULL; @@ -2547,11 +2531,6 @@ msg_error_t MsgStoGetRejectMsgList(const char *pNumber, msg_struct_list_s *pReje pRejectMsgList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(MSG_REJECT_MSG_INFO_S *)); - if (pRejectMsgList->msg_struct_info == NULL){ - dbHandle->freeTable(); - return MSG_ERR_NULL_POINTER; - } - msg_struct_s* pTmp = NULL; for (int i = 0; i < rowCnt; i++) { diff --git a/utils/MsgVMessage.cpp b/utils/MsgVMessage.cpp index 36d4fdb..ba17cdd 100755 --- a/utils/MsgVMessage.cpp +++ b/utils/MsgVMessage.cpp @@ -627,8 +627,6 @@ static inline int __msgsvc_vmsg_add_folding(char **buf, int *buf_size, int buf_l bool encode_64 = false; buf_copy = (char *)calloc(1, *buf_size); - if (buf_copy == NULL) - return -1; s = *buf; r = buf_copy; -- 2.7.4