Re: [spice-gtk] clipboard: Return early on fixup_clipboard_text errors()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 01, 2016 at 03:41:38PM +0200, Christophe Fergeau wrote:
> On Thu, Sep 01, 2016 at 01:57:16PM +0200, Pavel Grunt wrote:
> > Hi,
> > 
> > On Thu, 2016-09-01 at 13:11 +0200, Christophe Fergeau wrote:
> > > 5c8f400 "clipboard: Add clipboard_atom_to_vdagent_type helper"
> > > mistakenly removed some early returns when text conversion fails for
> > > some reason. This commit readds it.
> > > ---
> > >  src/spice-gtk-session.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
> > > index 5766bbd..e0a79de 100644
> > > --- a/src/spice-gtk-session.c
> > > +++ b/src/spice-gtk-session.c
> > > @@ -1026,6 +1026,9 @@ static void clipboard_received_text_cb(GtkClipboard
> > > *clipboard,
> > >  
> > >      /* gtk+ internal utf8 newline is always LF, even on windows */
> > >      conv = fixup_clipboard_text(self, text, &len);
> > > +    if (conv == NULL) {
> > > +        return;
> > > +    }
> > > 
> > 
> > I didn't think it is an issue since the following call deals with conv == NULL,
> > with this patch you should remove the ternary
> 
> Initially (before these patches), the ternary was used in the !text case I believe.
> I'd prefer to keep the initial behaviour of not sending clipboard data
> if the conversion failed.

Ah but the helper also returns NULL when no conversion is needed :(

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]