fix svace issue 88/100988/2
authorintae, jeon <intae.jeon@samsung.com>
Wed, 30 Nov 2016 05:04:00 +0000 (14:04 +0900)
committerintae, jeon <intae.jeon@samsung.com>
Wed, 30 Nov 2016 05:07:52 +0000 (14:07 +0900)
Change-Id: Ibb1a91e4474800fca68b22fbca2c3bdc9f8d875c
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
email-ipc/email-socket/email-ipc-socket.c

index f692a18..f7f7429 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 (!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 (!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);