aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus
diff options
context:
space:
mode:
authorPurushottam Kushwaha <p.kushwaha@samsung.com>2016-01-15 10:58:08 (GMT)
committerJouni Malinen <j@w1.fi>2016-01-15 18:16:13 (GMT)
commitbcce934755ce444cb885628e175df6515f8d390f (patch)
tree417b05f55aeae23b909eff73396f178e9c1784f0 /wpa_supplicant/dbus
parent7c70fe2c6e29804387e8e2916594570e1bedfe68 (diff)
downloadhostap-bcce934755ce444cb885628e175df6515f8d390f.zip
hostap-bcce934755ce444cb885628e175df6515f8d390f.tar.gz
hostap-bcce934755ce444cb885628e175df6515f8d390f.tar.bz2
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 <p.kushwaha@samsung.com>
Diffstat (limited to 'wpa_supplicant/dbus')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers_p2p.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index e2f0afc..73b9e20 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);