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>
This commit is contained in:
Tomas Carnecky 2009-12-07 05:54:57 +01:00 committed by Peter Hutterer
parent 92d9cb7e13
commit 8861407878
1 changed files with 7 additions and 5 deletions

View File

@ -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;
}