Bug 133896 - XGetWindowProperty and mismatched types
XGetWindowProperty and mismatched types
Status: NEW
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: High normal
: 2.21.3
Assigned To: Metacity maintainers list
Metacity maintainers list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2004-02-09 15:48 UTC by Owen Taylor
Modified: 2007-12-13 04:40 UTC (History)
3 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments

Description Owen Taylor 2004-02-09 15:48:02 UTC
GetWindowProperty has very strange behavior when the requested
type doesn't match the actual type

 * It returns the actual type to actual_type_return
 * It returns 0 to *nitems_return
 * It stores a 1-byte string containing \0 that needs
   to be XFree'ed into *prop_return.

xprops.c:get_property() is buggy here, most likely other uses
of GetWindowProperty are buggy also. The asynchronous
property retrieval code should be checked as well.

(I found bugs in the handling of this all over GTK+, thought
I'd file a bug here)
Comment 1 Thomas Thurman 2007-12-11 13:41:42 UTC
xprops.c:get_property() appears to have left this earth sometime during the 2.12 days, but many other functions in xprops.c call XGetWindowProperty(). I am thinking we need some kind of wrapper, then.

(yes, speedy triage here)
Comment 2 Elijah Newren 2007-12-13 04:40:16 UTC
Some additional notes: Kjartan fixed up a few of these that he caught with valgrind; there may not be any actual current bugs, though I agree a wrapper might prevent future ones.

I also tried reading over a few of these a couple different times, but got distracted before getting through all of them each time, and thus never got around to closing the bug out.  *shrug*

Note You need to log in before you can comment on or make changes to this bug.