summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-05-12 21:27:57 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-05-12 21:27:57 -0400
commit4453ba084aae5a00318b9dfdeda95e8eaa17494c (patch)
treeba095d813d0d766438f61ae0ea57c2812f63ca41
parent8834a0f22f36d7890691015ef93b3c77cf9b4bbb (diff)
server: Send error if client tries to bind to non-existant object
-rw-r--r--wayland/wayland-server.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/wayland/wayland-server.c b/wayland/wayland-server.c
index 572a5a9..0d76bb0 100644
--- a/wayland/wayland-server.c
+++ b/wayland/wayland-server.c
@@ -505,8 +505,15 @@ display_bind(struct wl_client *client,
struct wl_global *global;
wl_list_for_each(global, &display->global_list, link)
- if (global->object->id == id && global->func)
- global->func(client, global->object, version);
+ if (global->object->id == id)
+ 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