After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710449 - Invalid memory access in "gdk_x11_window_set_opacity" on 64bit platforms
Invalid memory access in "gdk_x11_window_set_opacity" on 64bit platforms
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-10-18 12:04 UTC by alextaran
Modified: 2017-01-29 23:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description alextaran 2013-10-18 12:04:06 UTC
In file: gdk/x11/gdkwindow-x11.c

In function: gdk_x11_window_set_opacity (GdkWindow *window, gdouble opacity)

guint32 cardinal;
...
XChangeProperty (..., 32, PropModeReplace, (guchar *) &cardinal, 1);

"man XChangeProperty" says:
"If the specified format is 32, the property data must be a long array."

That's because XChangeProperty casts this pointer to cardinal to (long*) and copies memory.

So, on 64bit platforms guint32 is 32bit, but XChangeProperty casts pointer &cardinal to (long*) and copies 8 bytes and causes invalid memory access.

This is known feature of XChangeProperty (for example, the same problem is here: https://bugs.freedesktop.org/show_bug.cgi?id=16802).

The possible fix is quite simple: just change "guint32" to "gulong"