[PATCH] [xkb] Fix possible NULL dereference in XkbFlushLedEvents()

Tomas Carnecky tom at dbservice.com
Sun Dec 6 14:52:55 PST 2009


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 at dbservice.com>
---
 xkb/xkbLEDs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
index 59cdba4..dfdd5a2 100644
--- a/xkb/xkbLEDs.c
+++ b/xkb/xkbLEDs.c
@@ -750,7 +750,8 @@ XkbFlushLedEvents(	DeviceIntPtr			dev,
 	    XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
 	XkbSendExtensionDeviceNotify(dev,cause->client,ed);
     }
-    bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
+    if (ed)
+	bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
     return;
 }
 
-- 
1.6.5.4




More information about the xorg-devel mailing list