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

Alan Coopersmith alan.coopersmith at oracle.com
Fri Apr 16 09:21:41 PDT 2010


Tiago Vignatti wrote:
> Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
>  xkb/xkbEvents.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
> index 33741e9..c7f6a66 100644
> --- a/xkb/xkbEvents.c
> +++ b/xkb/xkbEvents.c
> @@ -1042,8 +1042,8 @@ XkbInterestPtr	interest;
>  	interest = interest->next;
>      }
>      interest = xalloc(sizeof(XkbInterestRec));
> -    bzero(interest,sizeof(XkbInterestRec));
>      if (interest) {
> +	bzero(interest,sizeof(XkbInterestRec));

or:
-      interest = xalloc(sizeof(XkbInterestRec));
-      bzero(interest,sizeof(XkbInterestRec));
+      interest = xcalloc(1, sizeof(XkbInterestRec));

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



More information about the xorg-devel mailing list