--- xc/programs/Xserver/dix/events.c.SAV 2005-11-25 17:18:04.000000000 -0700 +++ xc/programs/Xserver/dix/events.c 2005-11-25 17:18:24.000000000 -0700 @@ -3024,7 +3024,7 @@ #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif - if (xE->u.u.detail == 0) + if ((xE->u.u.detail == 0) || (butc->map[key] == 0)) return; if (xE->u.u.detail <= 5) butc->state |= (Button1Mask >> 1) << xE->u.u.detail; @@ -3043,7 +3043,7 @@ #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif - if (xE->u.u.detail == 0) + if ((xE->u.u.detail == 0) || (butc->map[key] == 0)) return; if (xE->u.u.detail <= 5) butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail);