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 51952 - invalid use of G_GNUC_CONST for gdk_atom_name()
invalid use of G_GNUC_CONST for gdk_atom_name()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-03-10 04:21 UTC by James Henstridge
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description James Henstridge 2001-03-10 04:21:23 UTC
It looks like gdk_atom_name() is specified as being a const return function
with G_GNUC_CONST.  However according to the X11 implementation, it returns
the name as a strdup'd string.

This means that gcc may optimise away a call to gdk_atom_name, returning a
memory address that someone else owns (and may have already freed),
potentially causing a crash.

The fix is to remove G_GNUC_CONST from the prototype in the gdkproperties.h
header.
Comment 1 Owen Taylor 2001-05-29 19:47:37 UTC
Tue May 29 15:46:54 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkproperty.h: Remove inappropriate G_GNUC_CONST
	(fixes #51952, James Henstridge)