symbols: fix index-out-of-bounds in FindAutomaticType

If we enter this branch, we have 3 <= width <= 4, so if the width is 3
than syms[3] is out of bounds.

Happily inherited from xkbcomp.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-09-24 10:16:09 +02:00
parent 504853de3b
commit eaf9515229
1 changed files with 2 additions and 1 deletions

View File

@ -1452,7 +1452,8 @@ FindAutomaticType(struct xkb_context *ctx, xkb_level_index_t width,
else if (width <= 4) {
if (syms && xkb_keysym_is_lower(syms[0]) &&
xkb_keysym_is_upper(syms[1]))
if (xkb_keysym_is_lower(syms[2]) && xkb_keysym_is_upper(syms[3]))
if (width == 4 && xkb_keysym_is_lower(syms[2]) &&
xkb_keysym_is_upper(syms[3]))
*typeNameRtrn =
xkb_atom_intern(ctx, "FOUR_LEVEL_ALPHABETIC");
else