[Spice-devel] [PATCH 03/10] server/reds: fix possible segfault when accessing vdagent from reds_update_mouse_mode after vdagent set to NULL

Hans de Goede hdegoede at redhat.com
Wed Jan 12 23:44:16 PST 2011


Ack.

On 01/13/2011 06:01 AM, Alon Levy wrote:
> ---
>   server/reds.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index d325e20..7b4782c 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -733,6 +733,8 @@ static void reds_agent_remove()
>       SpiceCharDeviceInstance *sin = vdagent;
>       SpiceCharDeviceInterface *sif;
>
> +    ASSERT(reds->agent_state.connected)
> +    reds->agent_state.connected = 0;
>       vdagent = NULL;
>       reds_update_mouse_mode();
>
> @@ -740,9 +742,7 @@ static void reds_agent_remove()
>           return;
>       }
>
> -    ASSERT(reds->agent_state.connected)
>       sif = SPICE_CONTAINEROF(sin->base.sif, SpiceCharDeviceInterface, base);
> -    reds->agent_state.connected = 0;
>       if (sif->state) {
>           sif->state(sin, reds->agent_state.connected);
>       }


More information about the Spice-devel mailing list