summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDominik Haumann <dhaumann@kde.org>2019-02-26 21:30:48 +0100
committerDominik Haumann <dhaumann@kde.org>2019-02-27 06:36:59 +0000
commit16cb578a8d102f1c937dcc3a07b88b24c9ed685a (patch)
treec77436d40e98c43b41906cf0cec854bc2dd93838 /src/plugins
parent96404f7ac89244c944adaa7533c6292e7a614311 (diff)
QSyntaxHighlighter: Fix crash when parent is a nullptr
QSyntaxHighlighter has the follwoing constructor taking a QObject QSyntaxHighlighter::QSyntaxHighlighter(QObject *parent) : QObject(*new QSyntaxHighlighterPrivate, parent) { if (parent->inherits("QTextEdit")) { // ... } } Typically, a 'parent' refers to the parent/child hierarchy in Qt and is allowed to be a nullptr. However, in this case, passing a nullptr will lead to a crash, as reported in https://bugs.kde.org/show_bug.cgi?id=404820 This patch makes the QSyntaxHighlighter constructor nullptr safe by checking if parent is a valid pointer. Change-Id: Ia4e9b46b94fd37e6ceb2cd0538594353fdc1e349 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Christoph Cullmann <cullmann@kde.org>
Diffstat (limited to 'src/plugins')
0 files changed, 0 insertions, 0 deletions