[PATCH] [DBus] Restrict DeviceName size to 32 Characters in setter

Purushottam Kushwaha p.kushwaha at samsung.com
Fri Jan 15 02:58:08 PST 2016


Signed-off-by: Purushottam Kushwaha <p.kushwaha at samsung.com>
---
 wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index e2f0afc..80cea63 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -945,7 +945,8 @@ dbus_bool_t wpas_dbus_setter_p2p_device_config(
 		if (os_strcmp(entry.key, "DeviceName") == 0) {
 			char *devname;
 
-			if (entry.type != DBUS_TYPE_STRING)
+			if (entry.type != DBUS_TYPE_STRING ||
+			    os_strlen(entry.str_value) > 32)
 				goto error;
 
 			devname = os_strdup(entry.str_value);
-- 
1.9.1


More information about the Hostap mailing list