[PATCH libXpm] Remove an erroneous check which causes

Guillem Jover guillem at hadrons.org
Mon Oct 10 21:08:33 PDT 2011


On Fri, 2011-10-07 at 18:09:41 -0700, Jeremy Huddleston wrote:
> Fixes regression introduced by: 50986a34f231fbc7a4b62466bd89bd4ae4027d2e
> https://bugs.freedesktop.org/show_bug.cgi?id=26589
> 
> Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
> ---
>  src/CrBufFrI.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/src/CrBufFrI.c b/src/CrBufFrI.c
> index 398c645..53aa05c 100644
> --- a/src/CrBufFrI.c
> +++ b/src/CrBufFrI.c
> @@ -312,8 +312,7 @@ WriteColors(
>  	strcpy(s, "\",\n");
>  	l = s + 3 - buf;
>  	if( *data_size                   >= UINT_MAX-l ||
> -	    *data_size + l               <= *used_size ||
> -	   (*data_size + l - *used_size) <= sizeof(buf))
> +	    *data_size + l               <= *used_size)
>  		return(XpmNoMemory);
>  	s = (char *) XpmRealloc(*dataptr, *data_size + l);
>  	if (!s)

Reviewed-by: Guillem Jover <guillem at hadrons.org>

regards,
guillem


More information about the xorg-devel mailing list