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>
This commit is contained in:
Purushottam Kushwaha 2016-01-15 10:58:08 +00:00 committed by Jouni Malinen
parent 7c70fe2c6e
commit bcce934755

View file

@ -945,7 +945,8 @@ dbus_bool_t wpas_dbus_setter_p2p_device_config(
if (os_strcmp(entry.key, "DeviceName") == 0) { if (os_strcmp(entry.key, "DeviceName") == 0) {
char *devname; 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; goto error;
devname = os_strdup(entry.str_value); devname = os_strdup(entry.str_value);