[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: XView bug/PPC machines available for developers?



On Mon, Sep 25, 2000 at 09:45:20AM +0200, Michael Schmitz wrote:
> I have to correct myself here: the __va_copy(avlist, avlist1) is
> utter BS. It expands to  *avlist1 = *avlist and avlist1 is not
> initialized -> null pointer dereferenced. 
> 
> Apply the following patch
> 
> --- lib/libxview/attr/attr.c.org	Sun Sep 24 22:22:04 2000
> +++ lib/libxview/attr/attr.c	Sun Sep 24 22:21:34 2000
> @@ -93,7 +93,11 @@
>     */
>  #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
>     __va_copy(valist, valist1);
> +#if defined(__powerpc__)
> +   avlist = avlist1;
> +#else
>     __va_copy(avlist, avlist1);
> +#endif
>  #else
>     valist = valist1;
>     avlist = avlist1;
> 
> and it just works (for me, YMMV, yadda). 
> 
> Sample packages in ftp.biophys.uni-duesseldorf.de:/pub/linux/powerpc/

Huh?  Your mileage WILL vary.  That defeats the entire point of using
__va_copy().  avlist1 is, I assume, a va_list; a va_list is an array
type, and so *avlist1 means avlist1[0], which does not dereference an
uninitialized pointer.  This patch is wrong.

A FAQ on this sort of problem has been posted to debian-powerpc about a
dozen times now, and also to debian-arm, IIRC.

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/



Reply to: