Bug 1234540 - verify the validity of hashEntry, if it's null return with NS_ERROR_FAILURE. r=michal

This commit is contained in:
Bogdan Postelnicu 2016-02-26 10:30:12 +02:00
parent 07161a924f
commit 7637865f1c

View File

@ -436,6 +436,9 @@ nsCacheEntryHashTable::AddEntry( nsCacheEntry *cacheEntry)
if (!cacheEntry) return NS_ERROR_NULL_POINTER;
hashEntry = table.Add(&(cacheEntry->mKey), fallible);
if (!hashEntry)
return NS_ERROR_FAILURE;
#ifndef DEBUG_dougt
NS_ASSERTION(((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry == 0,
"### nsCacheEntryHashTable::AddEntry - entry already used");