From 1bfc742f031af0787aa397ca58630fcb51c81bec Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 4 Mar 2007 21:38:50 +0000 Subject: [PATCH] don't pass random strings to g_print() without running them through %s. 2007-03-04 Michael Natterer * app/core/gimpobject.c (gimp_object_get_memsize): don't pass random strings to g_print() without running them through %s. Fixes crash/warning when the string contains '%'. svn path=/trunk/; revision=22042 --- ChangeLog | 6 ++++++ app/core/gimpobject.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6275c14b4..66c6fbbae0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-04 Michael Natterer + + * app/core/gimpobject.c (gimp_object_get_memsize): don't pass + random strings to g_print() without running them through %s. + Fixes crash/warning when the string contains '%'. + 2007-03-04 Hans Breuer * **/makefile.msc app/gimpcore.def : updated diff --git a/app/core/gimpobject.c b/app/core/gimpobject.c index 3c564fbee4..d36bbd656d 100644 --- a/app/core/gimpobject.c +++ b/app/core/gimpobject.c @@ -430,10 +430,15 @@ gimp_object_get_memsize (GimpObject *object, if (indent_level == 0) { - g_list_foreach (aggregation_tree, (GFunc) g_print, NULL); - g_list_foreach (aggregation_tree, (GFunc) g_free, NULL); - g_list_free (aggregation_tree); + GList *list; + for (list = aggregation_tree; list; list = g_list_next (list)) + { + g_print ("%s", (gchar *) list->data); + g_free (list->data); + } + + g_list_free (aggregation_tree); aggregation_tree = NULL; }