Skip to content

Commit

Permalink
MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
shenglei10 authored and lgao4 committed Nov 6, 2019
1 parent 0c1541d commit a7d69b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,7 @@ EdbPrintSource (
&RetObject,
&RetEntry
);
if (SymbolAddress == 0) {
if (SymbolAddress == 0 || RetEntry == NULL) {
return 0 ;
}

Expand Down

0 comments on commit a7d69b6

Please sign in to comment.