[0.2.74] fix coverity issues 51/172551/2 accepted/tizen/unified/20180316.062622 accepted/tizen/unified/20180328.010221 submit/tizen/20180315.045512 submit/tizen/20180319.053649
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 14 Mar 2018 10:38:34 +0000 (19:38 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 14 Mar 2018 10:40:01 +0000 (19:40 +0900)
Change-Id: I39dce5dd0ff0917c6b46120225c5d1f75631e6e1

muse/include/muse_player_msg.h
muse/src/muse_player.c
packaging/mmsvc-player.spec

index 911db7b..75c0ed8 100644 (file)
@@ -284,7 +284,7 @@ typedef struct {
 #define player_send_msg_with_fd(fd, tfd, msg) \
        do { \
                int __len__ = 0; \
-               if ((fd != MM_ERROR_INVALID_ARGUMENT) && muse_core_fd_is_valid(fd)) {   \
+               if ((fd > 0) && muse_core_fd_is_valid(fd)) {    \
                        __len__ = muse_core_msg_send_fd(fd, tfd, msg); \
                        if (__len__ <= 0) \
                                LOGE("sending message failed"); \
@@ -457,7 +457,7 @@ typedef struct {
                                MUSE_TYPE_##type2, #param2, __value2__, \
                                0); \
                __fd__ = muse_server_module_get_msg_fd(module); \
-               if (__fd__ != MM_ERROR_INVALID_ARGUMENT) {      \
+               if (__fd__ > 0) {       \
                        if (muse_core_msg_send_fd(__fd__, __tfd__, __sndMsg__) <= 0) { \
                                LOGE("sending message failed"); \
                                ret = PLAYER_ERROR_INVALID_OPERATION; \
index 065975d..e06840f 100644 (file)
@@ -400,6 +400,11 @@ static int _check_supportable(muse_module_h module, char *path)
 
        client_fd = muse_server_module_get_msg_fd(module);
 
+       if ((client_fd < 0) || !muse_core_fd_is_valid(client_fd)) {
+               LOGE("get msg fd failed : %d", client_fd);
+               return PLAYER_ERROR_INVALID_OPERATION;
+       }
+
        for (idx = 0; idx < NUM_OF_URI_PREFIX; idx++) {
                if (strncmp(path, uri_prefix[idx], strlen(uri_prefix[idx])) == 0) {
                        LOGD("internet privilege will be checked for %s path", uri_prefix[idx]);
index ab55793..f9fb788 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.73
+Version:    0.2.74
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0