[PATCH 2/4] dix: fix dereference before null check

Dave Airlie airlied at gmail.com
Tue Jun 26 02:58:56 PDT 2012


On Tue, Jun 26, 2012 at 1:00 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Found by Coverity.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Reviewed-by: Dave Airlie <airlied at redhat.com>

> ---
>  dix/touch.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/dix/touch.c b/dix/touch.c
> index aa17faf..8799502 100644
> --- a/dix/touch.c
> +++ b/dix/touch.c
> @@ -160,11 +160,13 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
>     int i;
>     TouchClassPtr t = dev->touch;
>     DDXTouchPointInfoPtr ti = NULL;
> -    Bool emulate_pointer = (t->mode == XIDirectTouch);
> +    Bool emulate_pointer;
>
>     if (!t)
>         return NULL;
>
> +    emulate_pointer = (t->mode == XIDirectTouch);
> +
>     /* Look for another active touchpoint with the same DDX ID. DDX
>      * touchpoints must be unique. */
>     if (TouchFindByDDXID(dev, ddx_id, FALSE))
> --
> 1.7.10.2
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list