WGID : 79378, 148142, 149574, 167281
Change-Id: I639ea68254b8f0cdaf7c49f21b2cee201b9a2ff7
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
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) {
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);
static GSList *_get_list(void)
{
GSList *list = NULL;
+ struct dirent de;
struct dirent *dp = NULL;
DIR *dir;
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;