diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-30 10:39:54 +1030 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-01-31 11:39:10 +1100 |
commit | bc72ef3a159efd67067322c043bba444869dc356 (patch) | |
tree | 029e92c1eec2c631a3fff86e5bdc8cc0afe003a8 | |
parent | e98027c3ac7195fec665ef393d980b02870ca1b8 (diff) |
xkb: don't update LEDs if they don't exist. (Bug #13961)
In some weird cases we call this function when there is no SrvLedInfo on the
device. And it turns out null-pointer dereferences are bad.
X.Org Bug 13961 <http://bugs.freedesktop.org/show_bug.cgi?id=13961>
(cherry picked from commit d954f9c80348de294602d931d387e5cd1ef4b9a5)
-rw-r--r-- | xkb/xkbLEDs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index d607d9066..d28973ced 100644 --- a/xkb/xkbLEDs.c +++ b/xkb/xkbLEDs.c @@ -63,6 +63,9 @@ XkbSrvLedInfoPtr sli; sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0); + if (!sli) + return update; + if (state_changes&(XkbModifierStateMask|XkbGroupStateMask)) update|= sli->usesEffective; if (state_changes&(XkbModifierBaseMask|XkbGroupBaseMask)) |