Fix coverity issue - Improper use of negative value 06/174506/1 accepted/tizen/unified/20180405.064335 submit/tizen/20180404.024456
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 2 Apr 2018 11:08:26 +0000 (20:08 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 2 Apr 2018 11:08:26 +0000 (20:08 +0900)
[Version] 0.3.16
[Profile] Common
[Issue Type] Coverity
[Dependency module] N/A

Change-Id: I74fd52d369c73d1020c1496b96aec60d7d627dc6
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
muse/src/muse_camera_dispatcher.c
packaging/mmsvc-camera.spec

index 19ccbcd..a4ff8c3 100644 (file)
@@ -1686,6 +1686,13 @@ int camera_dispatcher_start_preview(muse_module_h module)
 
        /* privilege check */
        client_fd = muse_server_module_get_msg_fd(module);
+       if (client_fd < 0) {
+               ret = CAMERA_ERROR_INVALID_OPERATION;
+               LOGE("failed to get fd %d", client_fd);
+               muse_camera_msg_return(api, class, ret, module);
+               return MUSE_CAMERA_ERROR_INVALID;
+       }
+
        if (!muse_server_security_check_cynara(client_fd, CAMERA_PRIVILEGE_NAME)) {
                ret = CAMERA_ERROR_PERMISSION_DENIED;
                LOGE("security check failed 0x%x", ret);
index fe2f4a8..d9edad7 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    0.3.15
+Version:    0.3.16
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0