Revision: 7399
http://mahogany.svn.sourceforge.net/mahogany/?rev=7399&view=rev
Author: vadz
Date: 2007-12-30 09:46:46 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
fix the pointer passed to hash_lookup(), it could be NULL resulting in a crash
Modified Paths:
--------------
trunk/M/src/mail/ThreadJWZ.cpp
Modified: trunk/M/src/mail/ThreadJWZ.cpp
===================================================================
--- trunk/M/src/mail/ThreadJWZ.cpp 2007-12-18 19:42:06 UTC (rev 7398)
+++ trunk/M/src/mail/ThreadJWZ.cpp 2007-12-30 17:46:46 UTC (rev 7399)
@@ -1102,18 +1102,14 @@
void Threader::add(HASHTAB *hTable, const String &str, ThreadContainer
*container) const
{
- // As I do not want to ensure that the String instance given
- // as key will last at least as long as the table, I copy its
- // value.
- // XNOFIXME: Is it possible to 'lock' the string until the hash-table
- // is destroyed ?
hash_add(hTable, strdup(str.utf8_str()), container, 0);
}
ThreadContainer *Threader::lookUp(HASHTAB *hTable, const String &s) const
{
- void** data = hash_lookup(hTable, s.char_str());
+ void** data = hash_lookup(hTable,
+ const_cast<char *>((const char *)s.utf8_str()));
if (data != 0)
return (ThreadContainer*)data[0];
else
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates