summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorTomas Carnecky <tom@dbservice.com>2009-12-07 05:54:57 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-11 11:37:36 +1000
commit886140787852c660978a9bb3abc7cc2702cbaed1 (patch)
treefc1032e8164143bbe1e13e573a2450c10077fb10 /xkb
parent92d9cb7e1340b259294ba317ea3a7d18487498b5 (diff)
Fix possible NULL dereference in XkbFlushLedEvents()
Through some code paths it is possible that NULL is being passed in the 'ed' parameter to XkbFlushLedEvents(). Make sure we don't pass it along to bzero(). Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbLEDs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
index 59cdba416..6ca80d784 100644
--- a/xkb/xkbLEDs.c
+++ b/xkb/xkbLEDs.c
@@ -745,12 +745,14 @@ XkbFlushLedEvents( DeviceIntPtr dev,
XkbDDXAccessXBeep(dev, _BEEP_LED_OFF, XkbAccessXFeedbackMask);
}
}
- if (ed && (ed->reason)) {
- if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
- XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
- XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+ if (ed) {
+ if (ed->reason) {
+ if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
+ XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
+ XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+ }
+ bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
}
- bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
return;
}