Kaydet (Commit) 1ad6f436 authored tarafından Herbert Dürr's avatar Herbert Dürr Kaydeden (comit) Caolán McNamara

protect UNO EnvStack's s_setCurrent() against unknown threadid

untracked threadIds have been observed and can result in crashes.
s_getCurrent() already checks them and s_setCurrent() does it now.

(cherry picked from commit bf8e3135)

Conflicts:
	cppu/source/uno/EnvStack.cxx

Change-Id: If35237179c1ee3b854e6183294ed72a6d0b105a8
üst 1cab60bb
...@@ -74,10 +74,15 @@ static void s_setCurrent(uno_Environment * pEnv) ...@@ -74,10 +74,15 @@ static void s_setCurrent(uno_Environment * pEnv)
osl::MutexGuard guard(s_threadMap_mutex::get()); osl::MutexGuard guard(s_threadMap_mutex::get());
ThreadMap &rThreadMap = s_threadMap::get(); ThreadMap &rThreadMap = s_threadMap::get();
if (pEnv) if (pEnv)
{
rThreadMap[threadId] = pEnv; rThreadMap[threadId] = pEnv;
}
else else
rThreadMap.erase(threadId); {
ThreadMap::iterator iEnv = rThreadMap.find(threadId);
if( iEnv != rThreadMap.end())
rThreadMap.erase(iEnv);
}
} }
static uno_Environment * s_getCurrent(void) static uno_Environment * s_getCurrent(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment