diff options
author | Herbert Dürr <hdu@apache.org> | 2013-05-02 09:24:10 +0000 |
---|---|---|
committer | Herbert Dürr <hdu@apache.org> | 2013-05-02 09:24:10 +0000 |
commit | bf8e3135ac906ce0ab7d6d9ccbd434f1597f2ff4 (patch) | |
tree | 8c67c125eb7ccb5b7f9cb52fbfdef4c577599b08 /cppu | |
parent | 684adcd970a1cc9bba71a3b0eb69add03a3a44da (diff) |
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.
Notes
Notes:
merged as: 1ad6f436b5cd937dfc9d91c284920efddd6ad185
Diffstat (limited to 'cppu')
-rw-r--r-- | cppu/source/uno/EnvStack.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx index 46865115d97f..6fce75c5ae5b 100644 --- a/cppu/source/uno/EnvStack.cxx +++ b/cppu/source/uno/EnvStack.cxx @@ -76,11 +76,11 @@ static void s_setCurrent(uno_Environment * pEnv) osl::MutexGuard guard(s_threadMap_mutex); if (pEnv) s_threadMap[threadId] = pEnv; - else { ThreadMap::iterator iEnv = s_threadMap.find(threadId); - s_threadMap.erase(iEnv); + if( iEnv != s_threadMap.end()) + s_threadMap.erase(iEnv); } } |