--- branches/KDE/3.5/kdebase/kcontrol/input/mouse.cpp	2006/08/21 21:01:48	575680
+++ branches/KDE/3.5/kdebase/kcontrol/input/mouse.cpp	2008/01/13 17:59:44	760922
@@ -725,8 +725,12 @@
   XChangePointerControl( kapp->getDisplay(),
                          true, true, int(qRound(accelRate*10)), 10, thresholdMove);
 
-  unsigned char map[20];
-  num_buttons = XGetPointerMapping(kapp->getDisplay(), map, 20);
+  // 256 might seems extreme, but X has already been known to return 32, 
+  // and we don't want to truncate things. Xlib limits the table to 256 bytes,
+  // so it's a good uper bound..
+  unsigned char map[256];
+  num_buttons = XGetPointerMapping(kapp->getDisplay(), map, 256);
+
   int remap=(num_buttons>=1);
   if (handedEnabled && (m_handedNeedsApply || force)) {
       if( num_buttons == 1 )
