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 75925 - gtk_curve_set_curve_type() will abort the process if called at the wrong time
gtk_curve_set_curve_type() will abort the process if called at the wrong time
Status: RESOLVED DUPLICATE of bug 57012
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-03-22 15:29 UTC by Paul Davis
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description Paul Davis 2002-03-22 15:29:39 UTC
gtk_curve_set_curve_type() will generally result in a call
to gtk_curve_interpolate(). neither function checks to see if the widget
has been sized yet. as a result, if gtk_curve_set_type() is called during
widget initialization, the call to gtk_curve_interpolate() finds itself
using a width of -1. This leads the following call:

          g_malloc (width * sizeof (foo))

to attempt to allocate -20 bytes, which aborts the program.

the documentation for gtk_curve_set_type() should either indicate
that it cannot be called till the curve has been realized, or better,
the functions should check on the current status of the widget and
act accordingly.
Comment 1 Owen Taylor 2002-03-22 15:34:00 UTC

*** This bug has been marked as a duplicate of 57012 ***