Commit 84677b96 authored by Simon Ser's avatar Simon Ser

client: check event opcode in queue_event

If the client binds to a global with an interface mismatch, it may receive an
event from the server with an unknown opcode. See [1].

Instead of crashing, print a more useful debug message and abort.

[1]: wayland/wayland#113Signed-off-by: Simon Ser's avatarSimon Ser <simon.ser@intel.com>
parent 17e49ba8
Pipeline #59515 passed with stage
in 2 minutes and 34 seconds
......@@ -1364,6 +1364,10 @@ queue_event(struct wl_display *display, int len)
return size;
}
if (opcode >= proxy->object.interface->event_count)
wl_abort("Interface '%s' has no event %u\n",
proxy->object.interface->name, opcode);
message = &proxy->object.interface->events[opcode];
closure = wl_connection_demarshal(display->connection, size,
&display->objects, message);
......
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