asyncDialogBox: lock box in fdWrite to prevent a uaf (#10759)
This commit is contained in:
parent
d4e8a44087
commit
aba2cfe7a8
2 changed files with 10 additions and 1 deletions
|
|
@ -46,6 +46,9 @@ CAsyncDialogBox::CAsyncDialogBox(const std::string& title, const std::string& de
|
|||
static int onFdWrite(int fd, uint32_t mask, void* data) {
|
||||
auto box = (CAsyncDialogBox*)data;
|
||||
|
||||
// lock the box to prevent a UAF
|
||||
auto lock = box->lockSelf();
|
||||
|
||||
box->onWrite(fd, mask);
|
||||
|
||||
return 0;
|
||||
|
|
@ -142,4 +145,8 @@ void CAsyncDialogBox::kill() {
|
|||
|
||||
bool CAsyncDialogBox::isRunning() const {
|
||||
return m_readEventSource;
|
||||
}
|
||||
}
|
||||
|
||||
SP<CAsyncDialogBox> CAsyncDialogBox::lockSelf() {
|
||||
return m_selfWeakReference.lock();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue