diff options
author | Shenglei Zhang <shenglei.zhang@intel.com> | 2019-10-15 10:30:27 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-11-06 13:26:27 +0800 |
commit | a7d69b6aafaae452e4b54d70c113de10c45dd54b (patch) | |
tree | 81f6029397aff5595eff0584d314d5f5ba04d840 | |
parent | 0c1541d457832d3f68158cf61d21c30fe32bb885 (diff) | |
download | edk2-a7d69b6aafaae452e4b54d70c113de10c45dd54b.tar.gz edk2-a7d69b6aafaae452e4b54d70c113de10c45dd54b.tar.bz2 edk2-a7d69b6aafaae452e4b54d70c113de10c45dd54b.zip |
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>
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 8e305e4243..7b453fa98c 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -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) {
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 85cc275c11..90a9b9fbd7 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -2062,7 +2062,7 @@ EdbPrintSource ( &RetObject,
&RetEntry
);
- if (SymbolAddress == 0) {
+ if (SymbolAddress == 0 || RetEntry == NULL) {
return 0 ;
}
|