Martin Dietze wrote: > On Mon, August 24, 2009, Carlos R. Mafra wrote: > >> The patch is making the 4th and 5th arguments of XGetWindowProperty() >> to be 'long' (as the prototype requires). So I remembered about this >> thread where you quoted the code above with XGetWindowProperty()... > > I tried this patch but no success. Actually this is what I > expected since the arguments to XGetWindowProperty() are no > pointers, i.e. they are simply passed by value. In our case > we've got int variables which are assigned to long variables > when the function is called, there's no harm in this at all.
I don't understand this well. I was reading more stuff and it seems that this whole XGetWindowProperty() is a mess with types of the arguments and return values. I think I will take much more time to learn all this. But doing the 0 --> 0L change etc in that patch for fvwm helped the guy in 64-bit mode and it is correct from a strict prototype point of view, so that is a cleanup. But there is also this comment in src/wmspec.c, from Dan himself, /* * TODO * ---- * * This file needs to be checked for all calls to XGetWindowProperty() and * proper checks need to be made on the returned values. Only checking for * return to be Success is not enough. -Dan */ So they knew about the fishiness at that time. >> Is your machine 64-bit, btw? :-) > > No, it's 32-bit. Then following the logic of that patch for fvwm, it would not help you anyway. That is meant for 64-bit. > To me the behaviour seems to be caused by buggy apps. Thus my > original patch may be a sensible way to deal with this anyway. > Better see it crash when looking for the source of the problem > but in the end better have a stable WM :) Right, although it never hurts to try to study a bit deeper and try to understand why that pointer was NULL. I naively thought that maybe the type mess of XGetWindowProperty() could have something to do with it, but it was quite a shot in the dark. Checking for NULL seems the obvious safe thing to do anyway, I will push your patch to the repo. -- To unsubscribe, send mail to [email protected].
