Re: [spice-gtk v2 2/2] channel-usbredir: prevent crash when calling without host

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

 



imho this should be in usbredir

It is not nice when library crashes your program

Pavel

On Wed, 2016-11-30 at 18:36 +0100, Victor Toso wrote:
> From: Victor Toso <me@xxxxxxxxxxxxxx>
> 
> Similar fix was done in 5b252b0f499601bcf387c02a4dd35d27ed34c
> 
> We should log a critical message instead of crashing the
> application.
> Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
> ---
>  src/channel-usbredir.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
> index 4837d68..392a35e 100644
> --- a/src/channel-usbredir.c
> +++ b/src/channel-usbredir.c
> @@ -817,6 +817,8 @@ static void
> spice_usbredir_channel_up(SpiceChannel *c)
>      SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(c);
>      SpiceUsbredirChannelPrivate *priv = channel->priv;
>  
> +    g_return_if_fail(priv->host != NULL);
> +
>      /* Flush any pending writes */
>      usbredirhost_write_guest_data(priv->host);
>  }
_______________________________________________
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]