[PATCH] nconfig: Fix segfault when menu is empty

From: Andrej Gelenberg
Date: Mon Aug 02 2010 - 05:41:36 EST


nconf crush with segfault if press right arrow in empty menu.

Signed-off-by: Andrej Gelenberg <andrej.gelenberg@xxxxxxx>
---
scripts/kconfig/nconf.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 762caf8..3db3ca6 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -676,6 +676,7 @@ static void *item_data(void)
struct mitem *mcur;

cur = current_item(curses_menu);
+ if ( ! cur ) return NULL;
mcur = (struct mitem *) item_userptr(cur);
return mcur->usrptr;

--
1.7.2.1


--------------090009090304030004090004--
--
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/