summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog
diff options
context:
space:
mode:
authorFrancisco Facioni <fran6co@gmail.com>2020-03-20 11:10:35 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-20 12:38:31 (GMT)
commitecc0086bfc754f5adc4e496ae025da4bb1796490 (patch)
tree902454d6089765e46eb6d1ddcbd4bafb1d618390 /Source/QtDialog
parente3185e3d1b92a95c18f22f70b3cef6944dd019eb (diff)
downloadCMake-ecc0086bfc754f5adc4e496ae025da4bb1796490.zip
CMake-ecc0086bfc754f5adc4e496ae025da4bb1796490.tar.gz
CMake-ecc0086bfc754f5adc4e496ae025da4bb1796490.tar.bz2
cmake-gui: Fix use-after-free in Open-possible check
Fix `QCMake::checkOpenPossible` to copy `toLocal8Bit().data()` before its lifetime expires.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/QCMake.cxx2
1 files changed, 1 insertions, 1 deletions
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);
}