Fixed SVACE issue 76/97076/2 accepted/tizen/3.0/common/20161116.144052 accepted/tizen/3.0/ivi/20161116.023507 accepted/tizen/3.0/mobile/20161116.023434 accepted/tizen/3.0/tv/20161116.023452 accepted/tizen/3.0/wearable/20161116.023459 submit/tizen_3.0/20161115.065311
authorgreatim <jaewon81.lim@samsung.com>
Fri, 11 Nov 2016 06:10:54 +0000 (15:10 +0900)
committergreatim <jaewon81.lim@samsung.com>
Mon, 14 Nov 2016 05:11:38 +0000 (14:11 +0900)
Fixed SVACE issue

Change-Id: Ia5f7ee4c56ae82702809ff0d69eb229594647a1f
Signed-off-by: greatim <jaewon81.lim@samsung.com>
src/default_plugin_appcmd.c
src/file_sync_service.c
src/parameter.h

index 947a8e5..3fd2f64 100644 (file)
@@ -656,7 +656,12 @@ static void run_appcmd_appinstallpath(appcmd_info* p_info) {
 static void run_appcmd_with_shell_process(appcmd_info* p_info) {
     int ret = -1;
 
-    if (p_info == NULL || p_info->gen_cmd_func == NULL) {
+    if (p_info == NULL) {
+        D("Invalid arguments. p_info is null\n");
+        return;
+    }
+
+    if (p_info->gen_cmd_func == NULL) {
         D("Invalid arguments.\n");
         p_info->exitcode = -1;
         return;
index ffaf0bc..6c418a5 100644 (file)
@@ -713,6 +713,8 @@ void file_sync_service(int fd, void *cookie)
                 goto fail;
             }
         }
+    } else {
+        sdb_close(s[1]);
     }
 
 
@@ -723,6 +725,5 @@ fail:
     D("sync: done\n");
     sync_send_label_notify(s[0], name, 0);
     sdb_close(s[0]);
-    sdb_close(s[1]);
     sdb_close(fd);
 }
index ea15996..5d9276c 100644 (file)
@@ -79,7 +79,7 @@ static __inline__ void make_string_parameter ( parameter* pstring, const char* f
     pstring->type = type_string;
     pstring->v_string.length = strlen ( buf );
     pstring->v_string.data = ( char* ) malloc ( pstring->v_string.length + 1 );
-    strcpy ( pstring->v_string.data, buf );
+    strncpy ( pstring->v_string.data, buf, pstring->v_string.length );
 }
 
 static __inline__ void release_parameters ( parameters* param )