summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2018-09-19 08:39:04 (GMT)
committerJaehyun Kim <jeik01.kim@samsung.com>2018-09-19 08:40:04 (GMT)
commit0ea80470841d34bbfb20de9341f9f8932e5adea5 (patch)
tree62f783735ab0bc8825846d3b543f7d586854acf6
parent69fdfb9d4858c30a5cccc956580fd0937ab1c24c (diff)
downloadconnman-0ea80470841d34bbfb20de9341f9f8932e5adea5.zip
connman-0ea80470841d34bbfb20de9341f9f8932e5adea5.tar.gz
connman-0ea80470841d34bbfb20de9341f9f8932e5adea5.tar.bz2
Change-Id: I969a45edc0d4e16d61de0050466cd80c92c7c5e1 Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rw-r--r--plugins/wifi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 8e8017d..fe753d7 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -3188,7 +3188,11 @@ static void ssid_init(GSupplicantSSID *ssid, struct connman_network *network)
ssid_data = connman_network_get_blob(network, "WiFi.SSID",
&ssid->ssid_len);
ssid->ssid = g_try_malloc0(ssid->ssid_len);
- memcpy(ssid->ssid, ssid_data, ssid->ssid_len);
+
+ if (!ssid->ssid)
+ ssid->ssid_len = 0;
+ else
+ memcpy(ssid->ssid, ssid_data, ssid->ssid_len);
#else
ssid->ssid = connman_network_get_blob(network, "WiFi.SSID",
&ssid->ssid_len);