[Spice-devel] [spice-gtk v1] gtk-session: reply agent's clipboard request on failure
Victor Toso
victortoso at redhat.com
Fri Feb 24 10:26:07 UTC 2017
Hi,
On Fri, Feb 24, 2017 at 11:04:38AM +0100, Pavel Grunt wrote:
> > > > > + selection = get_selection_from_clipboard(self->priv,
> > > > > clipboard);
> > > > > + g_return_if_fail(selection != -1);
> > >
> > > so is it not needed to notify here as well ?
> >
> > We can't without knowing the selection.
>
> hmhmhm, you can keep it, it is not related to the patch
>
> the g_return is not needed, selection is used by a function in channel
> main, and that function should verify it. There can be more
> improvements (clipboard_received_text_cb is called from
> clipboard_request which has info about the selection)
Okay, another improvement for later on them :)
> > > > > conv = fixup_clipboard_text(self, text, &len);
> > > > > if (!check_clipboard_size_limits(self, len)) {
> > > > > - g_free(conv);
> > > > > - return;
> > > > > + SPICE_DEBUG("Failed sized limits of clipboard text
> > > > > (%d
> > > > > bytes)", len);
> > > > > + g_clear_pointer(&conv, g_free);
> > >
> > > thanks to goto there is no need to clear it
> >
> > We do. Conv might not have failed, this check checks the
> > clipboard_size_limits so, if limit exceed the protocol limit, we
> > need to
> > free conv here to send the right value to agent (nothing).
>
> it sends len = 0
But I don't think it is right to put a valid buffer and 0 as len.
At least I think we should avoid it.
toso
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170224/7055415a/attachment.sig>
More information about the Spice-devel
mailing list