[PATCH 05/12] xnest/keyboard: fix dereference before null check

Alan Coopersmith alan.coopersmith at oracle.com
Thu Oct 20 07:20:36 PDT 2011


On 10/20/11 03:44, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> pointed out by coverity.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
>   hw/xnest/Keyboard.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
> index ec629dc..c138438 100644
> --- a/hw/xnest/Keyboard.c
> +++ b/hw/xnest/Keyboard.c
> @@ -207,7 +207,7 @@ void
>   xnestUpdateModifierState(unsigned int state)
>   {
>     DeviceIntPtr pDev = xnestKeyboardDevice;
> -  KeyClassPtr keyc = pDev->key;
> +  KeyClassPtr keyc;
>     int i;
>     CARD8 mask;
>     int xkb_state;
> @@ -215,6 +215,7 @@ xnestUpdateModifierState(unsigned int state)
>     if (!pDev)
>         return;
>
> +  keyc = pDev->key;
>     xkb_state = XkbStateFieldFromRec(&pDev->key->xkbInfo->state);
>     state = state&  0xff;
>

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list