From 916ff8f8295eaecc0eb7c3807f4a7a6e4fe408b4 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sat, 14 Apr 2018 06:13:26 -0400 Subject: [PATCH] Check for valid _foregroundProcessInfo to prevent crash Summary: In Session::getUrl() check that _foregroundProcessInfo is valid before tyring to access its members. I couldn't reproduce the crash from the BR, but it is logical to call isValid() before accessing any ProcessInfo object members. BUG: 391447 Reviewers: #konsole, hindenburg Reviewed By: #konsole, hindenburg Subscribers: #konsole Tags: #konsole Differential Revision: https://phabricator.kde.org/D12175 --- src/Session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Session.cpp b/src/Session.cpp index f11cbacc..310bddde 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -1157,7 +1157,7 @@ QUrl Session::getUrl() bool ok = false; // check if foreground process is bookmark-able - if (isForegroundProcessActive()) { + if (isForegroundProcessActive() && _foregroundProcessInfo->isValid()) { // for remote connections, save the user and host // bright ideas to get the directory at the other end are welcome :) if (_foregroundProcessInfo->name(&ok) == QLatin1String("ssh") && ok) {