From: 이형주/Common Platform Lab(SR)/삼성전자 Date: Thu, 11 Aug 2022 08:11:06 +0000 (+0900) Subject: [Tizen] Null check for MemberLoader::FindMethod (#332) X-Git-Tag: accepted/tizen/6.5/unified/20220812.131039^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_6.5;p=platform%2Fupstream%2Fcoreclr.git [Tizen] Null check for MemberLoader::FindMethod (#332) * Null check for MemberLoader::FindMethod * Apply feedback --- diff --git a/src/vm/memberload.cpp b/src/vm/memberload.cpp index 4bd663a..7ea1610 100644 --- a/src/vm/memberload.cpp +++ b/src/vm/memberload.cpp @@ -1103,6 +1103,7 @@ MemberLoader::FindMethod( for (; it.IsValid(); it.Prev()) { MethodDesc *pCurDeclMD = it.GetDeclMethodDesc(); + LPCUTF8 pCurDeclMDName = NULL; #ifdef _DEBUG MethodTable *pCurDeclMT = pCurDeclMD->GetMethodTable(); CONSISTENCY_CHECK(!pMT->IsInterface() || pCurDeclMT == pMT->GetCanonicalMethodTable()); @@ -1117,7 +1118,8 @@ MemberLoader::FindMethod( || (pCurDeclMD->MightHaveName(targetNameHash) // This is done last since it is the most expensive of the IF statement. - && StrCompFunc(pszName, pCurDeclMD->GetName()) == 0) + && (pCurDeclMDName = pCurDeclMD->GetName()) != NULL + && StrCompFunc(pszName, pCurDeclMDName) == 0) ) { if (CompareMethodSigWithCorrectSubstitution(pSignature, cSignature, pModule, pCurDeclMD, pDefSubst, pMT))