From ecc0086bfc754f5adc4e496ae025da4bb1796490 Mon Sep 17 00:00:00 2001 From: Francisco Facioni Date: Fri, 20 Mar 2020 07:10:35 -0400 Subject: cmake-gui: Fix use-after-free in Open-possible check Fix `QCMake::checkOpenPossible` to copy `toLocal8Bit().data()` before its lifetime expires. --- Source/QtDialog/QCMake.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 3b5dc04..a9089e5 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -486,7 +486,7 @@ void QCMake::setWarnUnusedMode(bool value) void QCMake::checkOpenPossible() { - auto data = this->BinaryDirectory.toLocal8Bit().data(); + std::string data = this->BinaryDirectory.toLocal8Bit().data(); auto possible = this->CMakeInstance->Open(data, true); emit openPossible(possible); } -- cgit v0.12