From: Purushottam Kushwaha
Date: Fri, 15 Jan 2016 10:58:08 +0000 (+0000)
Subject: dbus: Restrict DeviceName size to 32 characters in setter
X-Git-Tag: hostap_2_6~976
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcce934755ce444cb885628e175df6515f8d390f;p=thirdparty%2Fhostap.git
dbus: Restrict DeviceName size to 32 characters in setter
The maximum WPS Device Name length is 32 characters and that limit was
already enforced for the control interface and configuration files.
Signed-off-by: Purushottam Kushwaha
---
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index e2f0afcb7..73b9e20c2 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) > WPS_DEV_NAME_MAX_LEN)
goto error;
devname = os_strdup(entry.str_value);