[Passwordsafe-devel] Re: secure allocator (addendum)
Popular easy-to-use and secure password manager
Brought to you by:
ronys
|
From: Edward E. <ed...@ya...> - 2002-03-19 01:52:43
|
Just to clear up a mistake I made, point 3 in my last email should
have said _dynamic_ initialization not static initialization. Also
the three variables it applies to are g_lockDH, g_DHBlock, and
g_dhinitializer, which are classes with constructors. The global
variable g_dwPageSize, a primitive type, is guaranteed to be set to 0
during static initialization before any program code executes. But
since g_dwPageSize only gets loaded with a useful value in the
constructor of g_dhinitializer, it is indirectly affected by this
problem as well. To recap, point 3 should read as below:
3) Thread synchronization is provided by a global lock variable
(g_lockDH). Initialization of this lock therefore occurs at an
unspecified time during the program's dynamic initialization.
If a method called elsewhere during dynamic initialization
attempts to use CDHAllocator, the lock may be uninitialized and
the results undefined (but almost certainly bad). This may
occur for instance in the constructor of a
vector<char, CDHAllocator<char> > declared at global scope in
another translation unit. The same applies to the global
variables g_dhinitializer and g_DHBlock, and indirectly to
g_dwPageSize.
Sorry for the confusion.
Edward Elliott
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
|