summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2017-02-23 12:32:07 +0000
committerDavid Edmundson <[email protected]>2017-02-23 12:32:07 +0000
commit755993315b6a362c5b782b1770c812f84c99b313 (patch)
treee65f2a264083b32a97ecdbcb2a9dcb285f8cad6f
parent8041c7d64f48407cb6fa5a2a5b75b4664589d705 (diff)
Fix potential crash in KCmFontInst on invalid index
Summary: If !index.isValid() grp remains null and any use of it will crash. There is a check for that, but then there's code relying on grp being valid both before and after that check. Test Plan: Compiles Reviewers: #plasma, mart Reviewed By: mart Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4394
-rw-r--r--kcms/kfontinst/kcmfontinst/KCmFontInst.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
index eb2fa71..1482b55 100644
--- a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
+++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
@@ -534,13 +534,15 @@ void CKCmFontInst::groupSelected(const QModelIndex &index)
if(index.isValid())
grp=static_cast<CGroupListItem *>(index.internalPointer());
+ else
+ return;
itsFontListView->setFilterGroup(grp);
setStatusBar();
//
// Check fonts listed within group are still valid!
- if(grp && grp->isCustom() && !grp->validated())
+ if(grp->isCustom() && !grp->validated())
{
QSet<QString> remList;
QSet<QString>::Iterator it(grp->families().begin()),