Details
Description
Before checking whether it's already been run (by checking it's "init count")
Initialize sets the global memory manager, thereby potentially changing the
memory manager during an allocation in another thread, corrupting memory.
The patch inline below fixes the problem (current CVS, PlatformuUtils.cpp)
Index: PlatformUtils.cpp
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/xercesc/util/PlatformUtils.cpp,v
retrieving revision 1.11
diff -w -b -u -p -r1.11 PlatformUtils.cpp
— PlatformUtils.cpp 27 Aug 2003 16:41:56 -0000 1.11
+++ PlatformUtils.cpp 20 Oct 2003 10:01:38 -0000
@@ -236,6 +236,17 @@ void XMLPlatformUtils::Initialize(const
if (gInitFlag == LONG_MAX)
return;
+ //
+ // Make sure we haven't already been initialized. Note that this is not
+ // thread safe and is not intended for that. Its more for those COM
+ // like processes that cannot keep up with whether they have initialized
+ // us yet or not.
+ //
+ gInitFlag++;
+
+ if (gInitFlag > 1)
+ return;
+
// Set pluggable memory manager
if (!fgMemoryManager)
}
- //
- // Make sure we haven't already been initialized. Note that this is not
- // thread safe and is not intended for that. Its more for those COM
- // like processes that cannot keep up with whether they have initialized
- // us yet or not.
- //
- gInitFlag++;
- - if (gInitFlag > 1)
- return;
-
/***
- Panic Handler:
*
HTH
rlc