fix svace issue 33/101633/3
authorintae, jeon <intae.jeon@samsung.com>
Wed, 30 Nov 2016 05:04:00 +0000 (14:04 +0900)
committerintae jeon <intae.jeon@samsung.com>
Fri, 2 Dec 2016 00:17:27 +0000 (16:17 -0800)
Change-Id: Ibb1a91e4474800fca68b22fbca2c3bdc9f8d875c
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
(cherry picked from commit ee0c4458745cae78c3e0e0e2267907b7ebae82b5)

email-ipc/email-socket/email-ipc-socket.c

index f692a18..9916f3b 100755 (executable)
@@ -219,6 +219,11 @@ EXPORT_API int emipc_open_email_socket(int fd, const char *path)
        SNPRINTF(uid_string, sizeof(uid_string), "%d", getuid());
        ipc_socket_path = g_strconcat(EM_SOCKET_USER_PATH, "/", uid_string, "/", EM_SOCKET_PATH_NAME, NULL);
 
+       if (NULL == ipc_socket_path) {
+               EM_DEBUG_EXCEPTION("ipc_socket_path is null");
+               return EMAIL_ERROR_SYSTEM_FAILURE;
+       }
+
        if (strcmp(path, ipc_socket_path) == 0 &&
                sd_listen_fds(1) == 1 &&
                sd_is_socket_unix(SD_LISTEN_FDS_START, SOCK_SEQPACKET, -1, ipc_socket_path, 0) > 0) {
@@ -296,6 +301,12 @@ EXPORT_API int emipc_connect_email_socket(int fd)
 
        memset(&server, 0, sizeof(server));
        server.sun_family = AF_UNIX;
+
+       if (NULL == ipc_socket_path) {
+               EM_DEBUG_EXCEPTION("ipc_socket_path is null");
+               return EMAIL_ERROR_SYSTEM_FAILURE;
+       }
+
        strncpy(server.sun_path, ipc_socket_path, sizeof(server.sun_path)-1);
 
        EM_SAFE_FREE(ipc_socket_path);