From 1e362fac92c6688fb42b195ccad16d7a337a34c1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 6 Jul 2014 10:54:57 -0700 Subject: [PATCH] Fix map->num_types check in XkbAddKeyType() Check is intended to ensure we allocate at least XkbNumRequiredTypes in map, but was accidentally marked with a ! causing the wrong check. Reported-by: Harms Reviewed-by: Matthieu Herrb Signed-off-by: Alan Coopersmith --- src/xkb/XKBMAlloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xkb/XKBMAlloc.c b/src/xkb/XKBMAlloc.c index 0b86aa1d..2e39634a 100644 --- a/src/xkb/XKBMAlloc.c +++ b/src/xkb/XKBMAlloc.c @@ -300,7 +300,7 @@ XkbAddKeyType(XkbDescPtr xkb, } } } - if ((!map) || (!map->types) || (!map->num_types < XkbNumRequiredTypes)) { + if ((!map) || (!map->types) || (map->num_types < XkbNumRequiredTypes)) { tmp = XkbNumRequiredTypes + 1; if (XkbAllocClientMap(xkb, XkbKeyTypesMask, tmp) != Success) return NULL;