MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry

Entry and RetEntry might be NULL before used.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Shenglei Zhang 2019-10-15 10:30:27 +08:00 committed by Liming Gao
parent 0c1541d457
commit a7d69b6aaf
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ DebuggerDisplaySymbolAccrodingToAddress (
// Find the nearest symbol address
//
CandidateAddress = EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNearestAddress, &Object, &Entry);
if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1) {
if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1 || Entry == NULL) {
EDBPrint (L"Symbole at Address not found!\n");
return EFI_DEBUG_CONTINUE;
} else if (Address != CandidateAddress) {

View File

@ -2062,7 +2062,7 @@ EdbPrintSource (
&RetObject,
&RetEntry
);
if (SymbolAddress == 0) {
if (SymbolAddress == 0 || RetEntry == NULL) {
return 0 ;
}