From 7f21588e9bb4989c3088a2b8e5a13c6b420d0c5d Mon Sep 17 00:00:00 2001 From: crs Date: Wed, 4 Sep 2002 20:17:54 +0000 Subject: [PATCH] fixed bug that caused the wrong keycode to be used for most, possibly all, keysyms. was reading past the end of an array of keysyms. --- lib/client/CXWindowsSecondaryScreen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/client/CXWindowsSecondaryScreen.cpp b/lib/client/CXWindowsSecondaryScreen.cpp index fe62e9f3..3f6c2ee3 100644 --- a/lib/client/CXWindowsSecondaryScreen.cpp +++ b/lib/client/CXWindowsSecondaryScreen.cpp @@ -917,7 +917,7 @@ void CXWindowsSecondaryScreen::updateKeycodeMap(Display* display) { // there are up to 4 keysyms per keycode - static const int numKeysyms = 4; + static const int maxKeysyms = 4; // get the number of keycodes int minKeycode, maxKeycode; @@ -930,6 +930,12 @@ CXWindowsSecondaryScreen::updateKeycodeMap(Display* display) minKeycode, numKeycodes, &keysymsPerKeycode); + // we only understand up to maxKeysyms keysyms per keycodes + int numKeysyms = keysymsPerKeycode; + if (numKeysyms > maxKeysyms) { + numKeysyms = maxKeysyms; + } + // initialize KeyCodeMask entry; m_keycodeMap.clear();