mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 12:16:40 +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:

committed by
Brad King

parent
e3185e3d1b
commit
ecc0086bfc
@@ -486,7 +486,7 @@ void QCMake::setWarnUnusedMode(bool value)
|
|||||||
|
|
||||||
void QCMake::checkOpenPossible()
|
void QCMake::checkOpenPossible()
|
||||||
{
|
{
|
||||||
auto data = this->BinaryDirectory.toLocal8Bit().data();
|
std::string data = this->BinaryDirectory.toLocal8Bit().data();
|
||||||
auto possible = this->CMakeInstance->Open(data, true);
|
auto possible = this->CMakeInstance->Open(data, true);
|
||||||
emit openPossible(possible);
|
emit openPossible(possible);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user