[PATCH 05/15] xkb: Check for unsuported comibnation of action for XkbSetMap

Pauli Nieminen ext-pauli.nieminen at nokia.com
Tue Jul 27 05:09:46 PDT 2010


This prevents validation code from using unitialized values.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 xkb/xkb.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 935f5ea..9a5d5b3 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -2366,6 +2366,14 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* va
 	}
     }
 
+    if ((!(req->present & XkbKeySymsMask) &&
+	    (req->present & XkbKeyActionsMask)) ||
+	(!(req->present & XkbKeyTypesMask) &&
+	    (req->present & XkbKeySymsMask))) {
+	client->errorValue = req->present;
+	return BadMatch;
+    }
+
     if ((req->present & XkbKeyTypesMask) &&
 	(!CheckKeyTypes(client,xkb,req,(xkbKeyTypeWireDesc **)&values,
 						&nTypes,mapWidths))) {
-- 
1.6.3.3



More information about the xorg-devel mailing list