Bug 1308397: Fix stack overflow by ensuring that ProxyAccessible::GetCOMInterface uses its real MSAA ID to lazily resolve its COM proxy, instead of using CHILDID_SELF; r=tbsaunde

MozReview-Commit-ID: 20xdOlcCXed
This commit is contained in:
Aaron Klotz 2016-10-17 12:39:16 -06:00
Родитель ea467855d3
Коммит 22d38ae56d
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -36,7 +36,12 @@ ProxyAccessible::GetCOMInterface(void** aOutAccessible) const
AccessibleWrap* wrap = WrapperFor(this);
bool isDefunct = false;
ProxyAccessible* thisPtr = const_cast<ProxyAccessible*>(this);
thisPtr->mCOMProxy = wrap->GetIAccessibleFor(kChildIdSelf, &isDefunct);
// NB: Don't pass CHILDID_SELF here, use the absolute MSAA ID. Otherwise
// GetIAccessibleFor will recurse into this function and we will just
// overflow the stack.
VARIANT realId = {VT_I4};
realId.ulVal = wrap->GetExistingID();
thisPtr->mCOMProxy = wrap->GetIAccessibleFor(realId, &isDefunct);
}
RefPtr<IAccessible> addRefed = mCOMProxy;