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 134202 - gdk_x11_gc_values_to_xvalues ::font field check missing
gdk_x11_gc_values_to_xvalues ::font field check missing
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Backend: X11
2.3.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-02-12 11:41 UTC by Olexiy Avramchenko
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small test case (557 bytes, text/plain)
2004-02-12 11:42 UTC, Olexiy Avramchenko
Details

Description Olexiy Avramchenko 2004-02-12 11:41:35 UTC
gdk_x11_gc_values_to_xvalues() function has no check on GdkGCValues::font
field. This causes segfault when trying to create new gc from values with
GDK_GC_FONT mask set.

"gdk/x11/gdkgc-x11.c"
if ((mask & GDK_GC_FONT) && (values->font->type == GDK_FONT_FONT))
should be
if ((mask & GDK_GC_FONT) && (values->font != NULL) && (values->font->type
== GDK_FONT_FONT))

This affects gtk+-2.2 as well.

Reported on gtk-app-devel-list by:
Bryan Brown <bbrown@saltmine.radix.net>
Comment 1 Olexiy Avramchenko 2004-02-12 11:42:51 UTC
Created attachment 24344 [details]
small test case
Comment 2 Matthias Clasen 2004-02-12 14:26:38 UTC
It is certainly invalid to set the GDK_GC_FONT mask when no font is 
contained in the values.
Comment 3 Owen Taylor 2004-02-12 15:29:15 UTC
I'd agree, though thanks for filing this bug report.