Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit 88e9ca5

Browse files
committed
Fix potential NULL pointer dereference
With the async behavior of Scanner (and its interactions in MainWindow), it isn't obvious that Session can't be non-NULL here. Hence it is probably better to move the session use into the if-guard. Resolves: #262 Signed-off-by: Alexander Scheel <[email protected]>
1 parent 21d37fd commit 88e9ca5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ResultViewer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ void ResultViewer::loadContent(Scanner* scanner)
113113

114114
if (mInputBaseName.endsWith("-xccdf"))
115115
mInputBaseName.chop(QString("-xccdf").length());
116-
}
117-
if (session->isSelectedProfileTailoring()) {
118-
tailoringFilePath = session->getTailoringFilePath();
116+
117+
if (session->isSelectedProfileTailoring()) {
118+
tailoringFilePath = session->getTailoringFilePath();
119+
}
119120
}
120121

121122
mReport.clear();

0 commit comments

Comments
 (0)