[PATCH] xkb: check for NULL pointer before dereferences it in XkbAddClientResource

Dan Nicholson dbn.lists at gmail.com
Tue Apr 20 05:49:24 PDT 2010


On Mon, Apr 19, 2010 at 10:58 AM, Tiago Vignatti
<tiago.vignatti at nokia.com> wrote:
> ---
>  xkb/xkbEvents.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
> index 33741e9..9755f98 100644
> --- a/xkb/xkbEvents.c
> +++ b/xkb/xkbEvents.c
> @@ -1041,8 +1041,7 @@ XkbInterestPtr    interest;
>            return ((interest->resource==id)?interest:NULL);
>        interest = interest->next;
>     }
> -    interest = xalloc(sizeof(XkbInterestRec));
> -    bzero(interest,sizeof(XkbInterestRec));
> +    interest = xcalloc(1, sizeof(XkbInterestRec));
>     if (interest) {
>        interest->dev = dev;
>        interest->client = client;
> --
> 1.6.0.4

Can you add your S-O-B before the pull request?

Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>


More information about the xorg-devel mailing list