Mouse un-plug crashy fun

Peter Hutterer peter.hutterer at who-t.net
Mon Jul 21 16:34:26 PDT 2008


On Mon, Jul 21, 2008 at 11:48:24AM -0700, Keith Packard wrote:
> Unplug a mouse, then warp the pointer and the warp pointer code will try
> to update the position of the last slave device associated with the
> master. That pointer will be stale and the X server will crash.
> 
> Does this seem like a sensible fix?
> 
> diff --git a/dix/devices.c b/dix/devices.c
> index 0a68c0e..82bcc64 100644
> --- a/dix/devices.c
> +++ b/dix/devices.c
> @@ -315,6 +315,14 @@ DisableDevice(DeviceIntPtr dev)
>                  AttachDevice(NULL, other, NULL);
>          }
>      }
> +    else
> +    {
> +        for (other = inputInfo.devices; other; other = other->next)
> +        {
> +	    if (other->isMaster && other->u.lastSlave == dev)
> +		other->u.lastSlave = NULL;
> +	}
> +    }
>  
>      if (dev->isMaster && dev->spriteInfo->sprite)
>      {

ACK, thanks!
I have it in my tree now, will find its way upstream soon.
 
Cheers,
  Peter



More information about the xorg mailing list