Fix the svace issue 21/197721/1 submit/tizen/20190116.015000
authorYoungHun Kim <yh8004.kim@samsung.com>
Wed, 16 Jan 2019 01:25:37 +0000 (10:25 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Wed, 16 Jan 2019 01:25:39 +0000 (10:25 +0900)
Change-Id: Id03c37441b6759414c91767706ec3ccceeb7b002

packaging/mused.spec
server/src/muse_server.c

index a83a3b2..1cb00fc 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.61
+Version:    0.3.62
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause
index d18d8ad..d51529c 100644 (file)
@@ -41,7 +41,7 @@ static void _ms_setup_syslog(void)
 static void _ms_fork(int *notify_fd)
 {
        pid_t pid;
-       int result, fds[2];
+       int fds[2];
        char err_msg[MUSE_MSG_LEN_MAX] = {'\0',};
        char msg[MUSE_MSG_LEN_MAX] = {'\0',};
 
@@ -58,7 +58,11 @@ static void _ms_fork(int *notify_fd)
        } else if (pid != 0) {
                close(fds[1]);
                /* Read in a string from the pipe */
-               result = read(fds[0], msg, sizeof(msg));
+               if (read(fds[0], msg, sizeof(msg)) <= 0) {
+                       LOGE("Failed to read from a file descriptor [%d]", fds[0]);
+                       close(fds[0]);
+                       return;
+               }
                close(fds[0]);
 
                /* Parent process closes up output side of pipe */