emuld: Fix contextual warnings
authorMunkyu Im <munkyu.im@samsung.com>
Fri, 16 Jan 2015 03:03:53 +0000 (12:03 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Fri, 16 Jan 2015 06:48:51 +0000 (15:48 +0900)
Change-Id: Iff8d7636d3cb0002ea00db3cdfc23bbe2836bff7
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
packaging/emuld.spec
src/common_dev.cpp

index f3ee96361ae68bd914ccf79215f1a4b6aa2b1800..4079b085617f9243c8c4b24558cb14dc8e82be1a 100644 (file)
@@ -1,5 +1,5 @@
 Name: emuld
-Version: 0.8.3
+Version: 0.8.4
 Release: 0
 Summary: Emulator daemon
 License: Apache-2.0
index 979f247170687af79327bdda4189f15043a0d6ae..bd90fe641875c08ae4a801792612749bb8c7c78a 100644 (file)
@@ -54,7 +54,7 @@ static pthread_mutex_t mutex_cmd = PTHREAD_MUTEX_INITIALIZER;
 // HDS
 #define IJTYPE_HDS          "hds"
 
-char SDpath[256];
+char SDpath[512];
 
 // Location
 #define STATUS              15
@@ -298,7 +298,7 @@ void msgproc_sdcard(const int sockfd, ijcommand* ijcmd)
             {
                 memset(SDpath, '\0', sizeof(SDpath));
                 ret = strtok(NULL, token);
-                strncpy(SDpath, ret, strlen(ret));
+                strncpy(SDpath, ret, sizeof(SDpath) -1);
                 LOGDEBUG("sdcard path is %s", SDpath);
 
                 mount_param* param = new mount_param(sockfd);
@@ -532,6 +532,8 @@ static void* getting_location(void* data)
 
     char* msg = 0;
     LXT_MESSAGE* packet = (LXT_MESSAGE*)malloc(sizeof(LXT_MESSAGE));
+    if (packet == NULL)
+        return 0;
 
     switch(param->ActionID)
     {
@@ -577,9 +579,7 @@ static void* getting_location(void* data)
         free(msg);
         msg = 0;
     }
-    if (packet != NULL) {
-        free(packet);
-    }
+    free(packet);
     if (param)
         delete param;