Avoid negative array subscript; break out of the loop if that happens.
authorPascal Stumpf <Pascal.Stumpf@cubes.de>
Tue, 27 Nov 2012 20:12:23 +0000 (21:12 +0100)
committerJon Trulson <jon@radscan.com>
Wed, 28 Nov 2012 06:46:12 +0000 (23:46 -0700)
cde/lib/DtTerm/TermPrim/TermPrim.c

index f32f01643372cc3178399f790f7f52a9335417e2..87c836d7c50b80b8464f615396538f9c67ddef2d 100644 (file)
@@ -894,6 +894,8 @@ GetMetaMask
        for (i1 = 0; i1 < modifierMapping->max_keypermod; i1++) {
            thisKeyCode = modifierMapping->modifiermap[mapIndex *
                    modifierMapping->max_keypermod + i1];
+           if (thisKeyCode < minKeycodes)
+               break;
            thisKeySym = keyboardMapping[(thisKeyCode - minKeycodes) *
                    keysymsPerKeycode];
            if ((thisKeySym == XK_Meta_L) || (thisKeySym == XK_Meta_R)) {