1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 10:47:59 +08:00

cmake-gui: Fix use-after-free in Open-possible check

Fix `QCMake::checkOpenPossible` to copy `toLocal8Bit().data()` before
its lifetime expires.
This commit is contained in:
Francisco Facioni
2020-03-20 07:10:35 -04:00
committed by Brad King
parent e3185e3d1b
commit ecc0086bfc

View File

@@ -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);
}