Fixed some svace issues 97/122397/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170403.190057 accepted/tizen/ivi/20170403.124608 accepted/tizen/mobile/20170403.124336 accepted/tizen/tv/20170403.124424 accepted/tizen/unified/20170403.124621 accepted/tizen/wearable/20170403.124532 submit/tizen/20170403.015738
authorhyunuktak <hyunuk.tak@samsung.com>
Fri, 31 Mar 2017 07:28:17 +0000 (16:28 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Fri, 31 Mar 2017 07:28:26 +0000 (16:28 +0900)
WGID : 79378, 148142, 149574, 167281

Change-Id: I639ea68254b8f0cdaf7c49f21b2cee201b9a2ff7
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
src/vpnsvc-internal.c
src/wifi-agent.c
src/wifi-config.c

index 5f7e3f1..1ccfcbf 100755 (executable)
@@ -632,7 +632,7 @@ static int get_interface_index(const char *iface_name)
        memset(&ifr, 0, sizeof(ifr));
 
        if (*iface_name)
-       strncpy(ifr.ifr_name, iface_name, strlen(iface_name));
+               strncpy(ifr.ifr_name, iface_name, IFNAMSIZ);
 
        /* get an interface name by ifindex */
        if (ioctl(sk, SIOCGIFINDEX, &ifr) < 0) {
index 2d3c745..b2dd9d7 100755 (executable)
@@ -127,7 +127,7 @@ gboolean netconfig_wifi_set_agent_field_for_eap_network(
        name_len = strlen(name);
        agent.ssid = g_byte_array_sized_new(name_len);
        agent.ssid->len = name_len;
-       memcpy(agent.ssid->data, name, name_len);
+       memcpy(agent.ssid->data, name, name_len + 1);
 
        if (identity)
                agent.identity = g_strdup(identity);
index aa2ab05..1f479a3 100755 (executable)
@@ -543,6 +543,7 @@ static gboolean _get_field(const gchar *config_id, const gchar *key, gchar **val
 static GSList *_get_list(void)
 {
        GSList *list = NULL;
+       struct dirent de;
        struct dirent *dp = NULL;
        DIR *dir;
 
@@ -552,7 +553,7 @@ static GSList *_get_list(void)
                return NULL;
        }
 
-       while ((dp = readdir(dir)) != NULL) {
+       while ((readdir_r(dir, &de, &dp) == 0) && (dp != NULL)) {
                if (g_strcmp0(dp->d_name, ".") == 0 || g_strcmp0(dp->d_name, "..") == 0 ||
                                strncmp(dp->d_name, WIFI_CONFIG_PREFIX, strlen(WIFI_CONFIG_PREFIX)) != 0) {
                        continue;