]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: Restrict DeviceName size to 32 characters in setter
authorPurushottam Kushwaha <p.kushwaha@samsung.com>
Fri, 15 Jan 2016 10:58:08 +0000 (10:58 +0000)
committerJouni Malinen <j@w1.fi>
Fri, 15 Jan 2016 18:16:13 +0000 (20:16 +0200)
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>
wpa_supplicant/dbus/dbus_new_handlers_p2p.c

index e2f0afcb70665fc9ffa9779e59cc9ee563a82ff9..73b9e20c20b049f299012781fc52131502342428 100644 (file)
@@ -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);