summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@nokia.com>2011-01-10 12:16:23 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-01-10 11:43:55 +0100
commit48de4396d54100e9b91cf84b903a72af1d3c9dc3 (patch)
tree58d61eb7e89834194ac5e0e1d8f9a8c77465960d /plugins
parent8426e2974fb672f9f5651cd7d4aec6581aa76304 (diff)
downloadconnman-48de4396d54100e9b91cf84b903a72af1d3c9dc3.tar.gz
connman-48de4396d54100e9b91cf84b903a72af1d3c9dc3.tar.bz2
connman-48de4396d54100e9b91cf84b903a72af1d3c9dc3.zip
wifi: Stack based crash risk fixed
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 62d9216b..040d2f92 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -645,7 +645,7 @@ static int network_connect(struct connman_network *network)
struct connman_device *device = connman_network_get_device(network);
struct wifi_data *wifi;
GSupplicantInterface *interface;
- GSupplicantSSID ssid;
+ GSupplicantSSID *ssid;
DBG("network %p", network);
@@ -656,16 +656,20 @@ static int network_connect(struct connman_network *network)
if (wifi == NULL)
return -ENODEV;
+ ssid = g_try_malloc0(sizeof(GSupplicantSSID));
+ if (ssid == NULL)
+ return -ENOMEM;
+
interface = wifi->interface;
- ssid_init(&ssid, network);
+ ssid_init(ssid, network);
if (wifi->disconnecting == TRUE)
wifi->pending_network = connman_network_ref(network);
else {
wifi->network = connman_network_ref(network);
- return g_supplicant_interface_connect(interface, &ssid,
+ return g_supplicant_interface_connect(interface, ssid,
connect_callback, NULL);
}