[Spice-devel] [PATCH] remove dandling pointer for RedCharDeviceVDIPort
Uri Lublin
uril at redhat.com
Mon May 2 10:13:24 UTC 2016
On 05/02/2016 11:25 AM, Frediano Ziglio wrote:
> This was caused by commit 1cec1c5118b65124de6bc6f984f376ff4e297bfb
> ("reds: Make VDIPortState a GObject") as the lifespan of RedCharDevice
> was changed.
>
> This could be reproduced with:
> - start rhel7 machine
> - connect remote viewer (RV)
> - RV: login
> - connect ssh
> - SSH: stop agent
> - disconnect RV
> - SSH: start agent
> - connect to RV
>
> and caused (using address sanitizer):
(snipped)
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/reds.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index efd1429..67c262a 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -603,12 +603,10 @@ void reds_client_disconnect(RedsState *reds, RedClient *client)
> reds_mig_remove_wait_disconnect_client(reds, client);
> }
>
Hi Frediano,
Shouldn't the patch fix "agent_attached" value instead of ignoring it ?
Why ignore its value here and not in other places ?
Regards,
Uri.
> - if (reds->agent_dev->priv->agent_attached) {
> - /* note that vdagent might be NULL, if the vdagent was once
> - * up and than was removed */
> - if (red_char_device_client_exists(RED_CHAR_DEVICE(reds->agent_dev), client)) {
> - red_char_device_client_remove(RED_CHAR_DEVICE(reds->agent_dev), client);
> - }
> + /* note that client might be NULL, if the vdagent was once
> + * up and than was removed */
> + if (red_char_device_client_exists(RED_CHAR_DEVICE(reds->agent_dev), client)) {
> + red_char_device_client_remove(RED_CHAR_DEVICE(reds->agent_dev), client);
> }
>
> ring_remove(&client->link);
>
More information about the Spice-devel
mailing list