Bug 663922 - Prevent null dereference of history transactions. r=smaug

This commit is contained in:
Josh Matthews 2011-06-22 12:52:41 -04:00
Родитель c25dc9c3aa
Коммит 3b87fa1e32
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -888,7 +888,7 @@ nsSHistory::EvictWindowContentViewers(PRInt32 aFromIndex, PRInt32 aToIndex)
// Walk the full session history and check that entries outside the window
// around aFromIndex have no content viewers
for (PRInt32 i = 0; i < mLength; ++i) {
for (PRInt32 i = 0; trans && i < mLength; ++i) {
if (i < aFromIndex - gHistoryMaxViewers ||
i > aFromIndex + gHistoryMaxViewers) {
nsCOMPtr<nsISHEntry> entry;
@ -1087,7 +1087,7 @@ nsSHistory::EvictExpiredContentViewerForEntry(nsISHEntry *aEntry)
GetTransactionAtIndex(startIndex, getter_AddRefs(trans));
PRInt32 i;
for (i = startIndex; i <= endIndex; ++i) {
for (i = startIndex; trans && i <= endIndex; ++i) {
nsCOMPtr<nsISHEntry> entry;
trans->GetSHEntry(getter_AddRefs(entry));
if (entry == aEntry)