On Fri, 2003-10-10 at 12:44, Greg Stark wrote:
> Owen Taylor <[EMAIL PROTECTED]> writes:
> 
> > However, that doesn't explain your behavior above. It's either
> > an Xserver or Xlib bug (unlikely, IMO, this stuff doesn't change
> > much at all), or a bug in the application code outside of what
> > you have quoted.
> 
> I'm sorry, I should have included the full code. The function is below. It
> crashes on the beginning of the for loop when it hits *prop.


>   if (items)
>     {
>       for (n = 1; *prop; n++)
>       {
>         new->names[n] = prop;
>         prop = strchr(prop, '\0') + 1;
>       }
>       new->numnames = n;
>     }

Nothing to do with XGetWindowProperty, consider the cases where the
property, with the terminated NUL that Xlib always appends is:

 a\0b\0\0

vs:

 a\0b\0

The second will crash that loop. I forget if the termiminating NUL is
required for WM_CLASS or not, but in any case you have to be robust 
about it not being there.

Regards,
                                                Owen


_______________________________________________
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86

Reply via email to