[PATCH 07/12] ephyr: fix dereference before null check.
Alan Coopersmith
alan.coopersmith at oracle.com
Thu Oct 20 07:23:36 PDT 2011
On 10/20/11 03:44, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> same as the xnest case.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
> hw/kdrive/ephyr/ephyr.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
> index 7ebf1c2..67376cc 100644
> --- a/hw/kdrive/ephyr/ephyr.c
> +++ b/hw/kdrive/ephyr/ephyr.c
> @@ -765,7 +765,7 @@ ephyrUpdateModifierState(unsigned int state)
> {
>
> DeviceIntPtr pDev = inputInfo.keyboard;
> - KeyClassPtr keyc = pDev->key;
> + KeyClassPtr keyc;
> int i;
> CARD8 mask;
> int xkb_state;
> @@ -773,6 +773,8 @@ ephyrUpdateModifierState(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>
I wouldn't complain should you choose to also fix the typo a few lines
later in that function at the same time:
/* Modifier shoud be down, but isn't
--
-Alan Coopersmith- alan.coopersmith at oracle.com
Oracle Solaris Platform Engineering: X Window System
More information about the xorg-devel
mailing list