summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <Brian.Cameron@sun.com>2009-04-24 17:20:03 -0500
committerBrian Cameron <Brian.Cameron@sun.com>2009-04-24 17:20:03 -0500
commitfa00f3e50a4a5a16ca00b08308f7fa6008b45d3e (patch)
tree648423d1d47de0524f8ecec2140a1b5b8b1b5e59
parent459b6a2e728ec4e8b48b3fcc3b4ec63c41e0c9d4 (diff)
downloadgdk-pixbuf-fa00f3e50a4a5a16ca00b08308f7fa6008b45d3e.tar.gz
Fix casting problem in gmodule code.
This fixes bug 579884. Previously the return value of g_slist_find_custom was being recasted as type (GtkModuleInfo *). This patch sets the return value to a temporary variable of type (GSList *), and sets info to temp->data. This avoids a crashing problem.
-rw-r--r--gtk/gtkmodules.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
index dddee9d55..a6b40d88b 100644
--- a/gtk/gtkmodules.c
+++ b/gtk/gtkmodules.c
@@ -289,9 +289,16 @@ load_module (GSList *module_list,
g_module_close (module);
else
{
+ GSList *temp;
+
success = TRUE;
- info = (GtkModuleInfo *) g_slist_find_custom (gtk_modules, module,
- (GCompareFunc)cmp_module);
+ info = NULL;
+
+ temp = g_slist_find_custom (gtk_modules, module,
+ (GCompareFunc)cmp_module);
+ if (temp != NULL)
+ info = temp->data;
+
if (!info)
{
info = g_new0 (GtkModuleInfo, 1);