diff options
author | kamaljeet chauhan <kamal.jc@samsung.com> | 2020-03-11 15:37:04 +0530 |
---|---|---|
committer | kamaljeet chauhan <kamal.jc@samsung.com> | 2020-03-11 15:37:04 +0530 |
commit | 8bf911119299c2a85345c5eaa5dcb497f7b2948b (patch) | |
tree | 30ecfa2db2cac936db801ebcccc0df393268d193 | |
parent | 9bf75fbe172e4651347411ef519544ce3f8acac7 (diff) | |
download | msg-service-8bf911119299c2a85345c5eaa5dcb497f7b2948b.tar.gz msg-service-8bf911119299c2a85345c5eaa5dcb497f7b2948b.tar.bz2 msg-service-8bf911119299c2a85345c5eaa5dcb497f7b2948b.zip |
Coverity issue fixessubmit/tizen/20200311.101233accepted/tizen/unified/20200316.220915
Change-Id: I16e115e32b06b70e24f741a282842bf6364d6bd0
Signed-off-by: kamaljeet chauhan <kamal.jc@samsung.com>
-rwxr-xr-x | externals/MsgSensorWrapper.cpp | 3 | ||||
-rwxr-xr-x | framework/plugin-manager/MsgPluginManager.cpp | 2 | ||||
-rwxr-xr-x | include/common/MsgCmdTypes.h | 2 | ||||
-rwxr-xr-x | plugin/mms_plugin/MmsPluginInternal.cpp | 5 | ||||
-rwxr-xr-x | plugin/mms_plugin/MmsPluginMessage.cpp | 3 | ||||
-rwxr-xr-x | plugin/mms_plugin/MmsPluginStorage.cpp | 6 | ||||
-rwxr-xr-x | proxy/MsgHandleSetting.cpp | 2 | ||||
-rwxr-xr-x | utils/MsgMmsMessage.cpp | 3 |
8 files changed, 17 insertions, 9 deletions
diff --git a/externals/MsgSensorWrapper.cpp b/externals/MsgSensorWrapper.cpp index bb8eb16..2daa1ba 100755 --- a/externals/MsgSensorWrapper.cpp +++ b/externals/MsgSensorWrapper.cpp @@ -134,7 +134,8 @@ void MsgSensorDisconnect() return; try { - gesture_stop_recognition(gestureHandler); + if(gesture_stop_recognition(gestureHandler)!= GESTURE_ERROR_NONE) + MSG_DEBUG("gesture_stop_recognition failed"); } catch(int exception) { MSG_FATAL("gesture_stop_recognition error [%d]", exception); } diff --git a/framework/plugin-manager/MsgPluginManager.cpp b/framework/plugin-manager/MsgPluginManager.cpp index aa0b83d..e743021 100755 --- a/framework/plugin-manager/MsgPluginManager.cpp +++ b/framework/plugin-manager/MsgPluginManager.cpp @@ -681,7 +681,7 @@ msg_error_t MsgSimMessageListener(MSG_MESSAGE_INFO_S *pMsg, int *simIdList, msg_ /*CID 48645: pEvent->data is an array hence null check is not required on it. */ if (retMsgId) { - memcpy(retMsgId, pEvent->data, sizeof(msg_message_id_t)); + memcpy(retMsgId, pEvent->data, sizeof(pEvent->data)); MSG_DEBUG("Saved SIM message ID = [%d]", *retMsgId); } diff --git a/include/common/MsgCmdTypes.h b/include/common/MsgCmdTypes.h index 587f5bc..748cc6d 100755 --- a/include/common/MsgCmdTypes.h +++ b/include/common/MsgCmdTypes.h @@ -43,7 +43,7 @@ typedef unsigned int MSG_EVENT_TYPE_T; typedef struct _MSG_CMD_S { MSG_CMD_TYPE_T cmdType; char cmdCookie[MAX_COOKIE_LEN]; - char cmdData[2]; + char cmdData[10]; } MSG_CMD_S; diff --git a/plugin/mms_plugin/MmsPluginInternal.cpp b/plugin/mms_plugin/MmsPluginInternal.cpp index 541fe37..3a21279 100755 --- a/plugin/mms_plugin/MmsPluginInternal.cpp +++ b/plugin/mms_plugin/MmsPluginInternal.cpp @@ -1175,7 +1175,10 @@ bool MmsPluginInternal::checkFilterMmsBody(MMS_DATA_S *pMmsData) } else { strncpy(filePath, pMedia->szFilePath, MSG_FILEPATH_LEN_MAX); - g_file_get_contents((const gchar*)filePath, (gchar**)&fileContent, NULL, NULL); + if(g_file_get_contents((const gchar*)filePath, (gchar**)&fileContent, NULL, NULL) == FALSE) + { + MSG_ERR("g_file_get_contents is failed"); + } bFiltered = MsgCheckFilterByWord(dbHandle, (const char *)fileContent); diff --git a/plugin/mms_plugin/MmsPluginMessage.cpp b/plugin/mms_plugin/MmsPluginMessage.cpp index 42a3daf..539fa74 100755 --- a/plugin/mms_plugin/MmsPluginMessage.cpp +++ b/plugin/mms_plugin/MmsPluginMessage.cpp @@ -1197,7 +1197,8 @@ bool MmsConvertMmsMsg(MmsMsg *pMmsMsg, MMS_DATA_S *pMmsData) gsize length = 0; if (MsgAccessFile(smil_multipart->szFilePath, F_OK)) { - g_file_get_contents((gchar*)smil_multipart->szFilePath, (gchar**)&contents, (gsize*)&length, NULL); + if(g_file_get_contents((gchar*)smil_multipart->szFilePath, (gchar**)&contents, (gsize*)&length, NULL) == FALSE) + MSG_ERR("g_file_get_contents is failed"); MmsInsertPresentation(pMmsMsg, MIME_APPLICATION_SMIL, NULL, contents, length); diff --git a/plugin/mms_plugin/MmsPluginStorage.cpp b/plugin/mms_plugin/MmsPluginStorage.cpp index 4844c51..75e1cf9 100755 --- a/plugin/mms_plugin/MmsPluginStorage.cpp +++ b/plugin/mms_plugin/MmsPluginStorage.cpp @@ -885,8 +885,10 @@ msg_error_t MmsPluginStorage::insertMultipart(msg_message_id_t msgId, MMS_MULTIP gchar *contents = NULL; gsize length = 0; - if (MsgAccessFile(pMultipart->szFilePath, F_OK)) - g_file_get_contents((gchar*)pMultipart->szFilePath, (gchar**)&contents, (gsize*)&length, NULL); + if (MsgAccessFile(pMultipart->szFilePath, F_OK)) { + if(g_file_get_contents((gchar*)pMultipart->szFilePath, (gchar**)&contents, (gsize*)&length, NULL) == FALSE) + MSG_ERR("g_file_get_contents is failed"); + } if (contents) { wrn = snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s " diff --git a/proxy/MsgHandleSetting.cpp b/proxy/MsgHandleSetting.cpp index 1502020..da80acb 100755 --- a/proxy/MsgHandleSetting.cpp +++ b/proxy/MsgHandleSetting.cpp @@ -814,7 +814,7 @@ msg_error_t MsgHandle::getGeneralOpt(msg_struct_t msg_struct) } if (pEvent->result == MSG_SUCCESS) { - memcpy(general_opt->data, pEvent->data, sizeof(MSG_GENERAL_OPT_S)); + memcpy(general_opt->data, pEvent->data, sizeof(pEvent->data)); } return pEvent->result; diff --git a/utils/MsgMmsMessage.cpp b/utils/MsgMmsMessage.cpp index 01af049..bbfe12c 100755 --- a/utils/MsgMmsMessage.cpp +++ b/utils/MsgMmsMessage.cpp @@ -1344,7 +1344,8 @@ int MsgMmsConvertMmsDataToMmsMessageData(MMS_DATA_S *pSrc, MMS_MESSAGE_DATA_S *p gchar *contents = NULL; gsize length = 0; - g_file_get_contents((gchar*)pSrc->smil->szFilePath, (gchar**)&contents, (gsize*)&length, NULL); + if(g_file_get_contents((gchar*)pSrc->smil->szFilePath, (gchar**)&contents, (gsize*)&length, NULL) == FALSE) + MSG_ERR("g_file_get_contents is failed"); if (contents) { MsgSmilParseSmilDoc(pDst, contents); |