Re: [PATCH spice-gtk 2/3] clipboard: pre-condition on selection value < 256

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

 



Hi,

On Fri, Mar 22, 2019 at 03:20:13PM +0100, marcandre.lureau@xxxxxxxxxx wrote:
> From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> 
> The protocol uses a u8 for the selection value. Make sure the given
> argument value fits there, or throw a critical.
> 
> The other places seem to use u8 variables already.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> ---
>  src/channel-main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/channel-main.c b/src/channel-main.c
> index 7d4b5c2..e359e8d 100644
> --- a/src/channel-main.c
> +++ b/src/channel-main.c
> @@ -1354,6 +1354,7 @@ static void agent_clipboard_grab(SpiceMainChannel *channel, guint selection,

This reminds me that this should be a bool. We don't need to
spice_channel_wakeup() if we fail anywhere here, I think.

>      if (!c->agent_connected)
>          return;
>  
> +    g_return_if_fail(selection < 256);

or <= G_MAXUINT8, either way

Acked-by: Victor Toso <victortoso@xxxxxxxxxx>

Still have to follow up the discussion on the new messages but
this one could be pushed anyway...

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 Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]