You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2013/05/02 11:24:10 UTC
svn commit: r1478305 - /openoffice/trunk/main/cppu/source/uno/EnvStack.cxx
Author: hdu
Date: Thu May 2 09:24:10 2013
New Revision: 1478305
URL: http://svn.apache.org/r1478305
Log:
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.
Modified:
openoffice/trunk/main/cppu/source/uno/EnvStack.cxx
Modified: openoffice/trunk/main/cppu/source/uno/EnvStack.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppu/source/uno/EnvStack.cxx?rev=1478305&r1=1478304&r2=1478305&view=diff
==============================================================================
--- openoffice/trunk/main/cppu/source/uno/EnvStack.cxx (original)
+++ openoffice/trunk/main/cppu/source/uno/EnvStack.cxx Thu May 2 09:24:10 2013
@@ -76,11 +76,11 @@ static void s_setCurrent(uno_Environment
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);
}
}