shell: Ignore unsolicited pong requests

If a client sends a pong message out of the blue, we deref ping_timer
which is NULL and then crash.  Unsolicited pong requests indicate that
something is wrong on the client, but the compositor should survide that.
dev
Kristian Høgsberg 13 years ago
parent cd8cdccdd3
commit 92374e1409
  1. 4
      src/shell.c

@ -1155,6 +1155,10 @@ shell_surface_pong(struct wl_client *client, struct wl_resource *resource,
struct wl_pointer *pointer; struct wl_pointer *pointer;
int was_unresponsive; int was_unresponsive;
if (shsurf->ping_timer == NULL)
/* Just ignore unsolicited pong. */
return;
if (shsurf->ping_timer->serial == serial) { if (shsurf->ping_timer->serial == serial) {
was_unresponsive = shsurf->unresponsive; was_unresponsive = shsurf->unresponsive;
shsurf->unresponsive = 0; shsurf->unresponsive = 0;

Loading…
Cancel
Save