fix bug 3559, 'Opening preferences window causes out of bounds read'
authorPaul <paul@claws-mail.org>
Sun, 15 Nov 2015 13:45:43 +0000 (13:45 +0000)
committerPaul <paul@claws-mail.org>
Sun, 15 Nov 2015 13:45:43 +0000 (13:45 +0000)
patch by Hanno Boeck

src/gtk/prefswindow.c

index f6c840b..3b9d3d6 100644 (file)
@@ -320,7 +320,7 @@ static void prefswindow_build_tree(GtkWidget *tree_view, GSList *prefs_pages,
                        gtk_tree_model_foreach(GTK_TREE_MODEL(store), 
                                               (GtkTreeModelForeachFunc) find_node_by_name,
                                               &find_name);
-                       if (find_name.found && page->path[i] != page->path[i-1]) {
+                       if (i > 0 && find_name.found && page->path[i] != page->path[i-1]) {
                                node = find_name.node;
                                gtk_tree_model_get(GTK_TREE_MODEL(store), &node,
                                                   PREFS_PAGE_DATA, &prefs_node,