[PATCH:libXt 2/3] GetResources: protect against underflow when type conversion fails

walter harms wharms at bfs.de
Sat Feb 5 02:40:11 PST 2011


Hello Alan,
here is an other bug  not related but also resource handling.

Whould you mind to take a look at this patch ?

https://bugs.freedesktop.org/show_bug.cgi?id=22543

I had simply no time to evaluate and this will change for the next weeks.


re,
 wh


Am 05.02.2011 07:29, schrieb Alan Coopersmith:
> Fix originally created by Leo Binchy for Sun to fix Solaris bug 1211553:
>  XtVaCreateManagedWidget with list of resources XtVaTypedArg cause core dump
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  src/Resources.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/Resources.c b/src/Resources.c
> index 304d3d5..dc0f563 100644
> --- a/src/Resources.c
> +++ b/src/Resources.c
> @@ -857,7 +857,7 @@ static XtCacheRef *GetResources(
>  		    register XtTypedArg* arg = typed_args + typed[j] - 1;
>  		    register int i;
>  
> -		    for (i = num_typed_args - typed[j]; i; i--, arg++) {
> +		    for (i = num_typed_args - typed[j]; i > 0; i--, arg++) {
>  			*arg = *(arg+1);
>  		    }
>  		    num_typed_args--;


More information about the xorg-devel mailing list