don't pass random strings to g_print() without running them through %s.

2007-03-04  Michael Natterer  <mitch@gimp.org>

	* 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
This commit is contained in:
Michael Natterer 2007-03-04 21:38:50 +00:00 committed by Michael Natterer
parent f8b13080e4
commit 1bfc742f03
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2007-03-04 Michael Natterer <mitch@gimp.org>
* 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 <hans@breuer.org> 2007-03-04 Hans Breuer <hans@breuer.org>
* **/makefile.msc app/gimpcore.def : updated * **/makefile.msc app/gimpcore.def : updated

View File

@ -430,10 +430,15 @@ gimp_object_get_memsize (GimpObject *object,
if (indent_level == 0) if (indent_level == 0)
{ {
g_list_foreach (aggregation_tree, (GFunc) g_print, NULL); GList *list;
g_list_foreach (aggregation_tree, (GFunc) g_free, NULL);
g_list_free (aggregation_tree);
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; aggregation_tree = NULL;
} }