mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-01 07:16:07 -04:00
server: Send error if client tries to bind to non-existant object
This commit is contained in:
parent
8834a0f22f
commit
4453ba084a
1 changed files with 9 additions and 2 deletions
|
|
@ -505,8 +505,15 @@ display_bind(struct wl_client *client,
|
||||||
struct wl_global *global;
|
struct wl_global *global;
|
||||||
|
|
||||||
wl_list_for_each(global, &display->global_list, link)
|
wl_list_for_each(global, &display->global_list, link)
|
||||||
if (global->object->id == id && global->func)
|
if (global->object->id == id)
|
||||||
global->func(client, global->object, version);
|
break;
|
||||||
|
|
||||||
|
if (&global->link == &display->global_list)
|
||||||
|
wl_client_post_error(client, &client->display->object,
|
||||||
|
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
|
"invalid object %d", id);
|
||||||
|
else if (global->func)
|
||||||
|
global->func(client, global->object, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue