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@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
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel