linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Cyrill V. Gorcunov" <gorcunov@gmail.com>
To: kernel list <linux-kernel@vger.kernel.org>
Cc: zippel@linux-m68k.org
Subject: [PATCH] qconf: fix SIGSEGV on empty menu items
Date: Thu, 4 Jan 2007 21:06:37 +0300	[thread overview]
Message-ID: <200701042106.37338.gorcunov@gmail.com> (raw)

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

Signed-off-by: Cyrill V. Gorcunov <gorcunov@gmail.com>
---
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 0b2fcc4..0694d1d 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -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)
@@ -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)
@@ -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: ";
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 6fc1c5f..a397edb 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -273,6 +273,8 @@ protected:
        struct symbol *sym;
        struct menu *menu;
        bool _showDebug;
+
+       int has_dbg_info;
 };
 
 class ConfigSearchWindow : public QDialog {

             reply	other threads:[~2007-01-04 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-04 18:06 Cyrill V. Gorcunov [this message]
2007-01-06  3:20 ` [PATCH] qconf: fix SIGSEGV on empty menu items Roman Zippel
2007-01-06 11:46   ` Bauke Jan Douma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200701042106.37338.gorcunov@gmail.com \
    --to=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).