[PATCH] fixes: Make sure invisible cursor is inialized with zero src/mask

Peter Hutterer peter.hutterer at who-t.net
Sun Sep 20 02:34:54 PDT 2009


On Sun, Sep 20, 2009 at 01:55:29AM -0400, Thomas Jaeger wrote:
> From f338f599028b026b5916e490114577c97855b227 Mon Sep 17 00:00:00 2001
> From: Thomas Jaeger <ThJaeger at gmail.com>
> Date: Sun, 20 Sep 2009 01:31:59 -0400
> Subject: [PATCH] fixes: Make sure invisible cursor is inialized with zero src/mask
> 
> This fixes a regression introduced in 9040dab76182d1a019ca7fef7b29733d2c199e61.
> 
> Signed-off-by: Thomas Jaeger <ThJaeger at gmail.com>
> ---
>  xfixes/cursor.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/xfixes/cursor.c b/xfixes/cursor.c
> index 0c70660..aac90e3 100644
> --- a/xfixes/cursor.c
> +++ b/xfixes/cursor.c
> @@ -1049,13 +1049,11 @@ createInvisibleCursor (void)
>      unsigned char *psrcbits, *pmaskbits;
>      CursorMetricRec cm;
>  
> -    psrcbits = (unsigned char *) xalloc(4);
> -    pmaskbits = (unsigned char *) xalloc(4);
> +    psrcbits = (unsigned char *) xcalloc(4, 1);
> +    pmaskbits = (unsigned char *) xcalloc(4, 1);
>      if (psrcbits == NULL || pmaskbits == NULL) {
>  	return NULL;
>      }
> -    *psrcbits = 0;
> -    *pmaskbits = 0;
>  
>      cm.width = 1;
>      cm.height = 1;
> -- 
> 1.6.3.3

pushed, thanks for the patch.

Cheers,
  Peter


More information about the xorg-devel mailing list