[PATCH] gconfig segfaults & compile error fix

From: Romain Lievin
Date: Mon Jan 05 2004 - 15:37:05 EST


Hi,

this patch fix a segfault problem (Roman Zippel) as well as some compile warnings (Buddy Lucas).

Patch was against 2.6.0.

Thanks, Romain.
======================[ cut here ]=========================
diff -Naur linux-2.6.0/scripts/kconfig/gconf.c linux/scripts/kconfig/gconf.c
--- linux-2.6.0/scripts/kconfig/gconf.c 2003-12-18 03:59:41.000000000 +0100
+++ linux/scripts/kconfig/gconf.c 2003-12-24 15:31:06.000000000 +0100
@@ -1,7 +1,7 @@
/* Hey EMACS -*- linux-c -*- */
/*
*
- * Copyright (C) 2002-2003 Romain Lievin <roms@xxxxxxxxxxxxxx>
+ * Copyright (C) 2002-2003 Romain Lievin <roms@xxxxxxxxx>
* Released under the terms of the GNU GPL v2.0.
*
*/
@@ -1047,6 +1047,8 @@
return FALSE;

gtk_tree_model_get_iter(model2, &iter, path);
+ if(!gtk_tree_store_iter_is_valid(model2, &iter))
+ return FALSE;
gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);

col = column2index(column);
@@ -1172,7 +1174,7 @@

gtk_widget_realize(tree2_w);
gtk_tree_view_set_cursor(view, path, NULL, FALSE);
- gtk_widget_grab_focus(GTK_TREE_VIEW(tree2_w));
+ gtk_widget_grab_focus(tree2_w);

return FALSE;
}
@@ -1401,7 +1403,6 @@
struct symbol *sym;
struct property *prop;
struct menu *menu1, *menu2;
- static GtkTreePath *path = NULL;

if (src == &rootmenu)
indent = 1;
@@ -1526,7 +1527,7 @@
if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT)) ||
(view_mode == FULL_VIEW)
|| (view_mode == SPLIT_VIEW))*/
- if ((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT)
+ if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
|| (view_mode == FULL_VIEW) || (view_mode == SPLIT_VIEW)) {
indent++;
display_tree(child);

--
Romain Liïvin (roms): <roms@xxxxxxxxx>
Web site: http://tilp.info
"Linux, y'a moins bien mais c'est plus cher !"






-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/