Fix Coverity Issues-2 73/158673/3 accepted/tizen/unified/20171106.162850 submit/tizen/20171106.073235
authoraravind.gara <aravind.gara@samsung.com>
Thu, 2 Nov 2017 10:08:05 +0000 (19:08 +0900)
committeraravind.gara <aravind.gara@samsung.com>
Mon, 6 Nov 2017 06:30:05 +0000 (15:30 +0900)
Fix local issues got by Coverity script

[Version] 0.0.11
[Issue Type] Security

Change-Id: Ic4c0988e39e7224fee03804166fe981a865955f5
Signed-off-by: aravind.gara <aravind.gara@samsung.com>
packaging/capi-media-sound-pool.spec
test/proxy/src/proxy.c

index a6bfafd..34b0b57 100644 (file)
@@ -1,5 +1,5 @@
 Name:       capi-media-sound-pool
-Version:    0.0.10
+Version:    0.0.11
 Summary:    Tizen Sound Pool module
 Release:    0
 Group:      Multimedia/Framework
index 1719b75..a9c3afa 100644 (file)
@@ -680,7 +680,7 @@ static int __proxy_sound_pool_load_source_from_file(const char *pars)
 
        /* If tag wasn't specified by the user, we will use file path as a tag */
        if (tag[0] == '\0')
-               strncpy(tag, fname, MAX_PATH_LEN);
+               strncpy(tag, fname, MAX_PATH_LEN - 1);
 
        _logger_log_info(CMD_LOAD_SOURCE " command was called");
        _logger_log_info("Loading source to the pool with %zu identifier from %s file. "
@@ -1064,8 +1064,6 @@ static int __proxy_sound_pool_get_stream_state(const char *pars)
 /* CMD_SLEEP */
 static int __proxy_sleep(const char *pars)
 {
-       int ret = SOUND_POOL_ERROR_NONE;
-
        useconds_t stime = 0;
 
        if ((pars == NULL) || (sscanf(pars, " %u", &stime) < 1)) {
@@ -1080,7 +1078,7 @@ static int __proxy_sleep(const char *pars)
        usleep(stime);
        _logger_log_info("Main thread sleep has been finished...", stime);
 
-       return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
+       return OK;
 }
 
 /* CMD_EXECUTE_SCRIPT */