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

Peter Hutterer peter.hutterer at who-t.net
Sun Dec 6 21:48:15 PST 2009


On Mon, Dec 07, 2009 at 05:54:57AM +0100, Tomas Carnecky wrote:
> 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 |   14 ++++++++------
>  1 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
> index 59cdba4..a9d5cfb 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);
> -    }
> -    bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
> +    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));
> +    } 
>      return;
>  }
>  
> -- 
> 1.6.5.5

merged, thanks.
 
Cheers,
  Peter


More information about the xorg-devel mailing list