diff options
author | Brian Cameron <Brian.Cameron@sun.com> | 2009-04-24 18:16:15 -0500 |
---|---|---|
committer | Brian Cameron <Brian.Cameron@sun.com> | 2009-04-24 18:16:15 -0500 |
commit | f43a78a892981b220ecbb90245da3c8370cab2fe (patch) | |
tree | 3fba0bd3fd340ea19475e1bd89636712e885fcf7 | |
parent | 28a6068eb9bb748c49e8c1efde7cb881e46e02f5 (diff) | |
download | gtk+-f43a78a892981b220ecbb90245da3c8370cab2fe.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.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c index dddee9d550..a6b40d88b5 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); |