[PATCH] clipboard: initialise clipboard memory after creation

Kristian Høgsberg hoegsberg at gmail.com
Sun Jul 1 18:06:00 PDT 2012


On Sat, Jun 30, 2012 at 06:33:34PM +0200, Rafal Mielniczuk wrote:
> In case we don't, weston segfault in clipboard_set_selection
> on:
> if (clipboard->source)
> 		clipboard_source_unref(clipboard->source);

Thanks, applied.  I think this should fix

  https://bugs.freedesktop.org/show_bug.cgi?id=51398

Kristian

> ---
>  src/clipboard.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/clipboard.c b/src/clipboard.c
> index 92c8a83..22d4b26 100644
> --- a/src/clipboard.c
> +++ b/src/clipboard.c
> @@ -251,6 +251,7 @@ clipboard_create(struct weston_seat *seat)
>  	clipboard = malloc(sizeof *clipboard);
>  	if (clipboard == NULL)
>  		return NULL;
> +	memset(clipboard, 0, sizeof *clipboard);
>  
>  	clipboard->seat = seat;
>  	clipboard->selection_listener.notify = clipboard_set_selection;
> -- 
> 1.7.11.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list