[PATCH] qconf: fix SIGSEGV on empty menu items

qconf may cause SIGSEGV by trying to show debug information on empty menu
items

Signed-off-by: Cyrill V. Gorcunov <gorcunov@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Cyrill V. Gorcunov and committed by Linus Torvalds 73b8ed29 f2e12bb2

+12 -2
+10 -2
scripts/kconfig/qconf.cc
··· 925 925 configSettings->endGroup(); 926 926 connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); 927 927 } 928 + 929 + has_dbg_info = 0; 928 930 } 929 931 930 932 void ConfigInfoView::saveSettings(void) ··· 955 953 if (menu == m) 956 954 return; 957 955 menu = m; 958 - if (!menu) 956 + if (!menu) { 957 + has_dbg_info = 0; 959 958 clear(); 960 - else 959 + } else { 960 + has_dbg_info = 1; 961 961 menuInfo(); 962 + } 962 963 } 963 964 964 965 void ConfigInfoView::setSource(const QString& name) ··· 995 990 void ConfigInfoView::symbolInfo(void) 996 991 { 997 992 QString str; 993 + 994 + if (!has_dbg_info) 995 + return; 998 996 999 997 str += "<big>Symbol: <b>"; 1000 998 str += print_filter(sym->name);
+2
scripts/kconfig/qconf.h
··· 273 273 struct symbol *sym; 274 274 struct menu *menu; 275 275 bool _showDebug; 276 + 277 + int has_dbg_info; 276 278 }; 277 279 278 280 class ConfigSearchWindow : public QDialog {