diff options
author | marcus <marcus@FreeBSD.org> | 2003-10-17 01:12:49 +0000 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2003-10-17 01:12:49 +0000 |
commit | d0c5513935da827f79591dd0ab3bc554f2889bbf (patch) | |
tree | 49f21acf40e4809820171671e187f3bb0576b0d2 /x11-toolkits/gnome-themes | |
parent | 283d764d6ff9029390da518ae0a4246c5c895e40 (diff) | |
download | FreeBSD-ports-d0c5513935da827f79591dd0ab3bc554f2889bbf.zip FreeBSD-ports-d0c5513935da827f79591dd0ab3bc554f2889bbf.tar.gz |
Fix a potential stack overflow crash in the Crux theme by allocating memory
with g_malloc() instead of alloca().
PR: 56752
Tested by: Jeremy Messenger <mezz7@cox.net>
Diffstat (limited to 'x11-toolkits/gnome-themes')
3 files changed, 46 insertions, 0 deletions
diff --git a/x11-toolkits/gnome-themes/Makefile b/x11-toolkits/gnome-themes/Makefile index fa81935..8c7259b 100644 --- a/x11-toolkits/gnome-themes/Makefile +++ b/x11-toolkits/gnome-themes/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnome-themes PORTVERSION= 2.4.1 +PORTREVISION= 1 CATEGORIES= x11-toolkits gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/${PORTNAME}/2.4 diff --git a/x11-toolkits/gnome-themes/files/patch-gtk-themes_Crux_src_crux-gradient.c b/x11-toolkits/gnome-themes/files/patch-gtk-themes_Crux_src_crux-gradient.c new file mode 100644 index 0000000..9111a7a --- /dev/null +++ b/x11-toolkits/gnome-themes/files/patch-gtk-themes_Crux_src_crux-gradient.c @@ -0,0 +1,31 @@ +--- gtk-themes/Crux/src/crux-gradient.c.orig Thu Oct 16 20:57:05 2003 ++++ gtk-themes/Crux/src/crux-gradient.c Thu Oct 16 21:01:18 2003 +@@ -207,7 +207,7 @@ + const eazel_engine_gradient *gradient) + { + int rgb_size = clip_rect->height; +- guchar *rgb = alloca (rgb_size * 3), *ptr; ++ guchar *rgb = g_malloc (rgb_size * 3), *ptr; + + eazel_engine_fill_gradient_rgb_buffer (gradient, full_rect->height, rgb, + clip_rect->y - full_rect->y, +@@ -239,7 +239,7 @@ + } + else + { +- guchar *xrgb = alloca (clip_rect->width * clip_rect->height * 3); ++ guchar *xrgb = g_malloc (clip_rect->width * clip_rect->height * 3); + int x, y; + guchar *ptr_in = rgb, *ptr_out = xrgb; + for (y = 0; y < clip_rect->height; y++) +@@ -257,7 +257,10 @@ + gdk_draw_rgb_image (drawable, gc, clip_rect->x, clip_rect->y, + clip_rect->width, clip_rect->height, + dither_mode, xrgb, clip_rect->width * 3); ++ g_free (xrgb); + } ++ ++ g_free (rgb); + } + + static void diff --git a/x11-toolkits/gnome-themes/files/patch-gtk-themes_Crux_src_crux-pixmaps.c b/x11-toolkits/gnome-themes/files/patch-gtk-themes_Crux_src_crux-pixmaps.c new file mode 100644 index 0000000..7813ce9 --- /dev/null +++ b/x11-toolkits/gnome-themes/files/patch-gtk-themes_Crux_src_crux-pixmaps.c @@ -0,0 +1,14 @@ +--- gtk-themes/Crux/src/crux-pixmaps.c.orig Thu Oct 16 21:01:59 2003 ++++ gtk-themes/Crux/src/crux-pixmaps.c Thu Oct 16 21:02:17 2003 +@@ -340,9 +340,10 @@ + { + GdkPixbuf *pixbuf; + size_t len = strlen (*path) + strlen (file) + 2; +- char *buf = alloca (len); ++ char *buf = g_malloc (len); + sprintf (buf, "%s/%s", *path, file); + pixbuf = gdk_pixbuf_new_from_file (buf, NULL); ++ g_free (buf); + if (pixbuf != 0) + return pixbuf; + path++; |