Commit f7f825c7 authored by Simon Ser's avatar Simon Ser

server: check global interface on bind

The interface name provided by the client isn't used at all.

Check it matches the global's interface name to prevent object interface
mismatches between the client and the server. These are especially easy to get
when mixing up global names and other IDs in the client.
Signed-off-by: Simon Ser's avatarSimon Ser <simon.ser@intel.com>
Closes: wayland/wayland#113
parent 17e49ba8
Pipeline #59522 passed with stage
in 1 minute and 26 seconds
......@@ -917,6 +917,12 @@ registry_bind(struct wl_client *client,
wl_resource_post_error(resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid global %s (%d)", interface, name);
else if (strcmp(global->interface->name, interface) != 0)
wl_resource_post_error(resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid interface for global %u: "
"have %s, wanted %s",
name, interface, global->interface->name);
else if (version == 0)
wl_resource_post_error(resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment