[Spice-devel] [spice-gtk v2] gtk-session: check if retrieving clipboard data failed

Pavel Grunt pgrunt at redhat.com
Fri Feb 24 13:58:36 UTC 2017


On Fri, 2017-02-24 at 10:19 +0100, Victor Toso wrote:
> From: Victor Toso <me at victortoso.com>
> 
> In case of failure, the GdkAtom *atoms will be set to NULL.
> Including this check to an early return.
> 
> Signed-off-by: Victor Toso <victortoso at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
> ---
>  src/spice-gtk-session.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
> index 0426d8f..8bef7d0 100644
> --- a/src/spice-gtk-session.c
> +++ b/src/spice-gtk-session.c
> @@ -609,6 +609,11 @@ static void clipboard_get_targets(GtkClipboard
> *clipboard,
>  
>      g_return_if_fail(SPICE_IS_GTK_SESSION(self));
>  
> +    if (atoms == NULL) {
> +        SPICE_DEBUG("Retrieving the clipboard data has failed");
> +        return;
> +    }
> +
>      SpiceGtkSessionPrivate *s = self->priv;
>      guint32 types[SPICE_N_ELEMENTS(atom2agent)];
>      char *name;


More information about the Spice-devel mailing list