nconfig: Fix segfault when menu is empty
Andrej Gelenberg [Mon, 2 Aug 2010 09:59:31 +0000 (11:59 +0200)]
nconf crush with segfault if press right arrow in empty menu.

Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Michal Marek <mmarek@suse.cz>

scripts/kconfig/nconf.c

index 762caf8..2ba71bc 100644 (file)
@@ -676,6 +676,8 @@ 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;