[PATCH] libx11 xkb/XKBMAlloc.c fix check for map->num_types
walter harms
wharms at bfs.de
Thu Jun 5 07:46:20 PDT 2014
fix: check for map->num_types overflow
compiletestested, i have no example to check this condition
but i guess that this was the original author intended
Signed-off-by: Harms <wharms at bfs,de>
---
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 f27fe4e..61bb413 100644
--- a/src/xkb/XKBMAlloc.c
+++ b/src/xkb/XKBMAlloc.c
@@ -302,7 +302,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.8.4.5
More information about the xorg-devel
mailing list