[Tizen] Null check for MemberLoader::FindMethod (#332) accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20220812.131039 submit/tizen_6.5/20220811.081453
author이형주/Common Platform Lab(SR)/삼성전자 <leee.lee@samsung.com>
Thu, 11 Aug 2022 08:11:06 +0000 (17:11 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 11 Aug 2022 08:11:06 +0000 (17:11 +0900)
* Null check for MemberLoader::FindMethod

* Apply feedback

src/vm/memberload.cpp

index 4bd663a..7ea1610 100644 (file)
@@ -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))