freebsd-ports/x11-themes/gnome-themes/files/patch-gtk-themes_Crux_src_crux-pixmaps.c
Joe Marcus Clarke 29a99fdfac 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>
2003-10-17 01:12:49 +00:00

14 lines
445 B
C

--- 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++;