Skip to content

Commit

Permalink
[PATCH] qconf: fix SIGSEGV on empty menu items
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cyrill V. Gorcunov authored and Linus Torvalds committed Jan 6, 2007
1 parent f2e12bb commit 73b8ed2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,8 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
configSettings->endGroup();
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
}

has_dbg_info = 0;
}

void ConfigInfoView::saveSettings(void)
Expand Down Expand Up @@ -953,10 +955,13 @@ void ConfigInfoView::setInfo(struct menu *m)
if (menu == m)
return;
menu = m;
if (!menu)
if (!menu) {
has_dbg_info = 0;
clear();
else
} else {
has_dbg_info = 1;
menuInfo();
}
}

void ConfigInfoView::setSource(const QString& name)
Expand Down Expand Up @@ -991,6 +996,9 @@ void ConfigInfoView::symbolInfo(void)
{
QString str;

if (!has_dbg_info)
return;

str += "<big>Symbol: <b>";
str += print_filter(sym->name);
str += "</b></big><br><br>value: ";
Expand Down
2 changes: 2 additions & 0 deletions scripts/kconfig/qconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ public slots:
struct symbol *sym;
struct menu *menu;
bool _showDebug;

int has_dbg_info;
};

class ConfigSearchWindow : public QDialog {
Expand Down

0 comments on commit 73b8ed2

Please sign in to comment.