From 136cffc2316a73570491bde8cc134c76b578fab9 Mon Sep 17 00:00:00 2001 From: Abhimanyu Swami Date: Wed, 17 Mar 2021 13:30:34 +0530 Subject: [PATCH] SVACE issue fix Change-Id: I6912495e50650f5e091063fffcd4450cff06f902 Signed-off-by: Abhimanyu Swami --- plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp | 7 ++++--- utils/MsgUtilStorage.cpp | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp b/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp index 5a92d5b..c00684c 100755 --- a/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp +++ b/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp @@ -2074,9 +2074,6 @@ int Sms3gpp2MsgCodec::encodeUserData(const unsigned char* src, unsigned char *de int shift = 0; unsigned char *tmp = (unsigned char *)calloc(1, src_size+1); - for (i = 0; i < src_size; i++) { - tmp[i] = src[i] << 1; - } if (tmp == NULL){ MSG_ERR("failed to allocate memory"); @@ -2084,6 +2081,10 @@ int Sms3gpp2MsgCodec::encodeUserData(const unsigned char* src, unsigned char *de } for (i = 0; i < src_size; i++) { + tmp[i] = src[i] << 1; + } + + for (i = 0; i < src_size; i++) { shift = j % 7; dest[j++] = (tmp[i] << shift) + (tmp[i+1] >> (7-shift)); if (shift == 6) { diff --git a/utils/MsgUtilStorage.cpp b/utils/MsgUtilStorage.cpp index 8dfcb78..e6b2c20 100755 --- a/utils/MsgUtilStorage.cpp +++ b/utils/MsgUtilStorage.cpp @@ -2230,7 +2230,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)); - memset(pConvViewList->msg_struct_info, 0x00, sizeof(msg_struct_t) * rowCnt); if (pConvViewList->msg_struct_info == NULL){ dbHandle->freeTable(); -- 2.7.4