Fix an issue that occurred when copying vsie 69/243069/1 accepted/tizen/unified/20200903.151713 submit/tizen/20200903.044940
authorJaehyun Kim <jeik01.kim@samsung.com>
Thu, 3 Sep 2020 02:56:40 +0000 (11:56 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Thu, 3 Sep 2020 02:56:40 +0000 (11:56 +0900)
Change-Id: I1e3acab009d0b5c2b25be5a2f4d0aecf9474094e
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/wifi_internal.c

index a13e52a..32658df 100755 (executable)
@@ -340,7 +340,16 @@ void __clear_profile_list(GSList **iterator)
 
 gpointer _wifi_copy_vsie_list(gconstpointer data, gpointer user_data)
 {
-       return g_strdup(data);
+       unsigned char *str = (unsigned char *)data;
+       unsigned char *vsie;
+       vsie = g_try_malloc0(str[1]+2);
+
+       if (vsie)
+               memcpy(vsie, str, str[1]+2);
+       else
+               WIFI_LOG(WIFI_ERROR, "Failed to allocate memory.");
+
+       return vsie;
 }
 
 gpointer _wifi_copy_bssid_list(gconstpointer data, gpointer user_data)