Fix SVACE (DEREF_OF_NULL.RET.STAT) issue 92/223592/2 accepted/tizen/unified/20200203.125758 submit/tizen/20200131.071650
authorYoungHun Kim <yh8004.kim@samsung.com>
Fri, 31 Jan 2020 05:10:49 +0000 (14:10 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Fri, 31 Jan 2020 05:56:28 +0000 (14:56 +0900)
Change-Id: I1cfb26c4308b296144624dfa5049a5a2e5522053

core/src/muse_core.c
packaging/mused.spec
server/src/muse_server_connection.c

index cf843e2..2b19bd8 100644 (file)
@@ -186,6 +186,7 @@ static gboolean _muse_msg_json_get_obj_value(json_object *obj, muse_core_msg_typ
 {
        int j_type, idx, len;
        int *int_data;
+       const char *src = NULL;
 
        muse_return_val_if_fail(obj, FALSE);
        muse_return_val_if_fail(data, FALSE);
@@ -219,7 +220,9 @@ static gboolean _muse_msg_json_get_obj_value(json_object *obj, muse_core_msg_typ
        case json_type_object:
                break;
        case json_type_string:
-               strncpy((char *)data, json_object_get_string(obj), strlen(json_object_get_string(obj)));
+               src = json_object_get_string(obj);
+               muse_return_val_if_fail(src, FALSE);
+               g_strlcpy((gchar *)data, src, MUSE_MSG_MAX_LENGTH);
                break;
        case json_type_array:
                int_data = (int *)data;
index 2bf9228..b649266 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.97
+Version:    0.3.98
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 0e69682..a7921a0 100644 (file)
@@ -163,7 +163,7 @@ gboolean ms_connection_get_state(ms_connection_state_e *state)
 
        ep_fd = connection->epfd;
 
-       do { /* We have to execute epoll_wait again in case of error of EINTR  */
+       do { /* We have to execute epoll_wait again in case of error of EINTR */
                gettimeofday(&tv_s, NULL);
                fd_count = epoll_wait(ep_fd, connection->events, MS_EVENT_MAX, MS_TIMEOUT_MSEC);
                if (fd_count < 0) {