[kde-doc-english] [trojita] src/Gui: GUI: fix segfault due to uninitialized variable

Jan Kundrát jkt at flaska.net
Sun Aug 18 20:28:34 UTC 2013


Git commit f138529153934d44552e62b5d8a60bec3fc137fa by Jan Kundrát.
Committed on 18/08/2013 at 20:24.
Pushed by jkt into branch 'master'.

GUI: fix segfault due to uninitialized variable

LineEdit has two constructors and one of them was missing a proper
initialization of the m_historyEnabled. This broke an assumption that a
(m_historyEnabled being true) implies (completer() != 0). One could trigger this
by opening the composer, attempting to send a mail with an empty subject with
cursor in the recipients widget, and pressing Esc twice which led to calling
QCompleter::completionMode with "this" set to nullptr.

M  +1    -1    src/Gui/LineEdit.cpp

http://commits.kde.org/trojita/f138529153934d44552e62b5d8a60bec3fc137fa

diff --git a/src/Gui/LineEdit.cpp b/src/Gui/LineEdit.cpp
index 0675f97..31f3009 100644
--- a/src/Gui/LineEdit.cpp
+++ b/src/Gui/LineEdit.cpp
@@ -26,7 +26,7 @@ LineEdit::LineEdit(const QString &text, QWidget *parent)
 }
 
 LineEdit::LineEdit(QWidget *parent)
-    : QLineEdit(parent)
+    : QLineEdit(parent), m_historyEnabled(false), m_historyPosition(0)
 {
     init();
 }


More information about the kde-doc-english mailing list