Re: [PATCH spice-gtk] gtk-session: Set value directly

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

 



On Fri, 2017-02-17 at 13:44 +0100, Pavel Grunt wrote:
> Spotted by coverity

Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>

out of curiosity, what did coverity actually say here?


> ---
>  src/spice-gtk-session.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
> index a3a2e90..5688cba 100644
> --- a/src/spice-gtk-session.c
> +++ b/src/spice-gtk-session.c
> @@ -916,25 +916,23 @@ static gboolean
> check_clipboard_size_limits(SpiceGtkSession *session,
>   */
>  static char *fixup_clipboard_text(SpiceGtkSession *self, const char
> *text, int *len)
>  {
>      char *conv = NULL;
> -    int new_len = *len;
>  
>      if (spice_main_agent_test_capability(self->priv->main,
> VD_AGENT_CAP_GUEST_LINEEND_CRLF)) {
>          conv = spice_unix2dos(text, *len);
> -        new_len = strlen(conv);
> +        *len = strlen(conv);
>      } else {
>          /* On Windows, with some versions of gtk+,
> GtkSelectionData::length
>           * will include the final '\0'. When a string with this
> trailing '\0'
>           * is pasted in some linux applications, it will be pasted
> as <NIL> or
>           * as an invisible character, which is unwanted. Ensure the
> length we
>           * send to the agent does not include any trailing '\0'
>           * This is gtk+ bug https://bugzilla.gnome.org/show_bug.cgi?
> id=734670
>           */
> -        new_len = strlen(text);
> +        *len = strlen(text);
>      }
>  
> -    *len = new_len;
>      return conv;
>  }
>  
>  static void clipboard_received_text_cb(GtkClipboard *clipboard,
_______________________________________________
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]