[PATCH 1/2] Fix segfault in client when demarshalling fails

Kristian Høgsberg krh at bitplanet.net
Mon Jul 18 10:01:19 PDT 2011


On Mon, Jul 18, 2011 at 2:00 AM, Casey Dahlin <cdahlin at redhat.com> wrote:

Ok, yup.  I changed it to just abort(), since it means that the server
sent invalid data.

Kristian

> ---
>  wayland/wayland-client.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/wayland/wayland-client.c b/wayland/wayland-client.c
> index ce27a90..d1ed25a 100644
> --- a/wayland/wayland-client.c
> +++ b/wayland/wayland-client.c
> @@ -521,6 +521,11 @@ handle_event(struct wl_display *display,
>        closure = wl_connection_demarshal(display->connection,
>                                          size, display->objects, message);
>
> +       if (! closure) {
> +               fprintf(stderr, "Error demarshalling closure: %m\n");
> +               return;
> +       }
> +
>        if (wl_debug)
>                wl_closure_print(closure, &proxy->object, false);
>
> --
> 1.7.6
>
>


More information about the wayland-devel mailing list