From: Kyeonghun Lee Date: Mon, 18 Jul 2016 00:26:53 +0000 (+0900) Subject: client crash fixed X-Git-Tag: submit/tizen/20160718.020011^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3b62a5cce5ff33f9fcaa97b98ee78c460cbc2b1;p=platform%2Fcore%2Fmessaging%2Fmsg-service.git client crash fixed Change-Id: I94e512f0f22fd7eb9847c441a9197af3106d20ed Signed-off-by: Kyeonghun Lee --- diff --git a/utils/MsgUtilFile.cpp b/utils/MsgUtilFile.cpp index 83a0b50..510d8f1 100755 --- a/utils/MsgUtilFile.cpp +++ b/utils/MsgUtilFile.cpp @@ -334,6 +334,16 @@ bool MsgOpenAndReadFile(const char *pFileName, char **ppData, int *pDataSize) snprintf(fullPath, MAX_FULL_PATH_SIZE, "%s%s", MSG_IPC_DATA_PATH, pFileName); MSG_SEC_DEBUG("open file name: %s", fullPath); + struct stat st; + if (stat(fullPath, &st) != 0) { + MSG_SEC_ERR("stat(%s, &st) != 0", fullPath); + return false; + } + if (S_ISDIR(st.st_mode)) { + MSG_ERR("S_ISDIR(st.st_mode)"); + return false; + } + pFile = MsgOpenFile(fullPath, "rb"); if (pFile == NULL) {