relyea%netscape.com 493a0a3758 Bug 225034 Certificate Manager Crashes Mozilla [@ nsCertTree::CmpByCrit]
sr=brendan r=wtc a=dbaron

The issue is the use of the PL_DHash* functions. It's possible that a given call
to PL_DHashOperate which adds a new entry may cause the hash table to expand,
and all the existing entries to be reallocated. PL_DHash does this by allocating
new memory, then copying the entries.

getCacheEntry() returns one of these hash entries. CmpBy() makes two consecutive
calls to getCacheEntry, then uses the returned entries for it's comparisons. If
the second entry call causes a new entry to be added to the table, and causes
the hash table to expand, the pointer to the first entry we retrieved will point
to freed memory.

The fix is to make the usable entry a pointer in the hashtable entry, and return
that pointer. When the hashtable rebuilds it's entries, the pointer will be
copied to the new entry and not be disturbed.


git-svn-id: svn://10.0.0.236/trunk@177782 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-15 21:23:51 +00:00
..
2005-08-06 21:34:04 +00:00
2005-06-02 02:03:05 +00:00