From 9390b7a133b0e17bc4d303effb7a99ff7017b086 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 7 Jun 2009 19:26:45 +1000 Subject: dix: protect against missing ButtonClasses in GetPointerMapping. Signed-off-by: Peter Hutterer --- dix/devices.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dix') diff --git a/dix/devices.c b/dix/devices.c index eb54e0aff..3996ca64a 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1724,10 +1724,11 @@ ProcGetPointerMapping(ClientPtr client) rep.type = X_Reply; rep.sequenceNumber = client->sequence; - rep.nElts = butc->numButtons; + rep.nElts = (butc) ? butc->numButtons : 0; rep.length = ((unsigned)rep.nElts + (4-1))/4; WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep); - (void)WriteToClient(client, (int)rep.nElts, (char *)&butc->map[1]); + if (butc) + WriteToClient(client, (int)rep.nElts, (char *)&butc->map[1]); return Success; } -- cgit v1.2.3