shell: Ignore unsolicited pong requests
authorKristian Høgsberg <krh@bitplanet.net>
Sun, 12 Aug 2012 02:39:12 +0000 (22:39 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 13 Aug 2012 14:01:46 +0000 (10:01 -0400)
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.

src/shell.c

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