[PATCH:libX11 1/2] Fix map->num_types check in XkbAddKeyType()

Alan Coopersmith alan.coopersmith at oracle.com
Wed Jul 9 13:34:43 PDT 2014


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 <wharms at bfs,de>
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 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 0b86aa1..2e39634 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;
-- 
1.7.9.2



More information about the xorg-devel mailing list