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) {
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);