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 153583 - Too much memory is allocated in shape for dash
Too much memory is allocated in shape for dash
Status: RESOLVED FIXED
Product: libgnomecanvas
Classification: Deprecated
Component: core
CVS HEAD
Other Linux
: Normal normal
: ---
Assigned To: libgnomecanvas maintainers
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2004-09-23 19:14 UTC by Peter G. Baum
Modified: 2006-11-12 22:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Peter G. Baum 2004-09-23 19:14:35 UTC
Too much memory is allocated in shape for dash.

Here is the patch to fix it:

*** gnome-canvas-shape.c        2004-09-23 21:02:39.047224712 +0200
--- gnome-canvas-shape-orig.c   2004-09-23 21:00:37.291734360 +0200
***************
*** 486,492 ****
                        priv->dash.offset = dash->offset;
                        priv->dash.n_dash = dash->n_dash;
                        if (dash->dash != NULL) {
!                               priv->dash.dash = g_new (double, dash->n_dash);
                                memcpy (priv->dash.dash, dash->dash,
dash->n_dash * sizeof (double));
                        }
                }
--- 486,492 ----
                        priv->dash.offset = dash->offset;
                        priv->dash.n_dash = dash->n_dash;
                        if (dash->dash != NULL) {
!                               priv->dash.dash = g_new (double, dash->n_dash *
sizeof (double));
                                memcpy (priv->dash.dash, dash->dash,
dash->n_dash * sizeof (double));
                        }
                }
Comment 1 Kjartan Maraas 2006-10-25 19:05:53 UTC
Looks like this was applied already.
Comment 2 Kjartan Maraas 2006-10-25 19:09:03 UTC
Or was the patch reversed?
Comment 3 Sven Herzberg 2006-11-12 21:35:46 UTC
The patch is reversed. But I don't think we have a test application to be used for dashes. I'm goint to write one.
Comment 4 Sven Herzberg 2006-11-12 22:16:59 UTC
2006-11-12  Sven Herzberg  <herzi@gnome-de.org>

        * demos/Makefile.am: build dash demo
        * demos/dash-demo.c: a demo to demonstrate the dash property
        * libgnomecanvas/gnome-canvas-shape.c: don't allocate too much memory.
        Closes bug #153583 (Patch from Peter G. Baum)