Discussion:
[PATCH] gsupplicant:Fix Potential crash issue in case dbus_malloc() fail
(too old to reply)
Maneesh Jain
2015-10-05 09:54:21 UTC
Permalink
Signed-off-by: Maneesh Jain <***@samsung.com>
---
gsupplicant/supplicant.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 9506f02..6a62026 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -4986,6 +4986,9 @@ int g_supplicant_interface_p2p_connect(GSupplicantInterface *interface,
return -ENOTSUP;

data = dbus_malloc0(sizeof(*data));
+ if (!data)
+ return -ENOMEM;
+
data->interface = interface;
data->path = g_strdup(interface->path);
data->peer = peer_params;
@@ -5130,6 +5133,9 @@ int g_supplicant_interface_p2p_add_service(GSupplicantInterface *interface,
return -ENOTSUP;

data = dbus_malloc0(sizeof(*data));
+ if (!data)
+ return -ENOMEM;
+
data->registration = true;
data->interface = interface;
data->service = p2p_service_params;
@@ -5160,6 +5166,9 @@ int g_supplicant_interface_p2p_del_service(GSupplicantInterface *interface,
return -ENOTSUP;

data = dbus_malloc0(sizeof(*data));
+ if (!data)
+ return -ENOMEM;
+
data->interface = interface;
data->service = p2p_service_params;

@@ -5245,6 +5254,9 @@ int g_supplicant_set_widi_ies(GSupplicantP2PServiceParams *p2p_service_params,
return -EFAULT;

data = dbus_malloc0(sizeof(*data));
+ if (!data)
+ return -ENOMEM;
+
data->service = p2p_service_params;
data->callback = callback;
data->user_data = user_data;
--
1.9.1
Patrik Flykt
2015-10-08 09:43:23 UTC
Permalink
Added a shor commit message and removed the signed off by. Applied!

Patrik

Loading...