[PATCH] mi: check for NULL pointer before dereferences it in miPointerSetPosition

Peter Hutterer peter.hutterer at who-t.net
Sun Apr 18 16:43:01 PDT 2010


On Fri, Apr 16, 2010 at 06:42:26PM +0300, Tiago Vignatti wrote:
> Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
>  mi/mipointer.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mi/mipointer.c b/mi/mipointer.c
> index e1f63be..1b33f82 100644
> --- a/mi/mipointer.c
> +++ b/mi/mipointer.c
> @@ -497,14 +497,14 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
>  
>      miPointerPtr        pPointer; 
>  
> +    if (!pDev || !pDev->coreEvents)
> +        return;
> +
>      pPointer = MIPOINTER(pDev);
>      pScreen = pPointer->pScreen;
>      if (!pScreen)
>  	return;	    /* called before ready */
>  
> -    if (!pDev || !pDev->coreEvents)
> -        return;
> -
>      if (*x < 0 || *x >= pScreen->width || *y < 0 || *y >= pScreen->height)
>      {
>  	pScreenPriv = GetScreenPrivate (pScreen);
> -- 
> 1.6.0.4

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>



More information about the xorg-devel mailing list