openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1478305 - /openoffice/trunk/main/cppu/source/uno/EnvStack.cxx
Date Thu, 02 May 2013 09:24:10 GMT
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);
 	}
 }
 



Mime
View raw message