Skip to content

Commit

Permalink
Check if pointer is null to prevent AV (#67963)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelle-rogers authored Apr 14, 2022
1 parent 52ae06e commit 1a296c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/vm/methodtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ BOOL MethodTable::ValidateWithPossibleAV()
// for that. We need to do more sanity checking to
// make sure that our pointer here is in fact a valid object.
PTR_EEClass pEEClass = this->GetClassWithPossibleAV();
return ((this == pEEClass->GetMethodTableWithPossibleAV()) ||
return ((pEEClass && (this == pEEClass->GetMethodTableWithPossibleAV())) ||
((HasInstantiation() || IsArray()) &&
(pEEClass->GetMethodTableWithPossibleAV()->GetClassWithPossibleAV() == pEEClass)));
(pEEClass && (pEEClass->GetMethodTableWithPossibleAV()->GetClassWithPossibleAV() == pEEClass))));
}

#ifndef DACCESS_COMPILE
Expand Down

0 comments on commit 1a296c0

Please sign in to comment.