[edk2-devel] [PATCH 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry
Wu, Hao A
hao.a.wu at intel.com
Wed Oct 30 07:00:57 UTC 2019
> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Thursday, October 17, 2019 11:31 AM
> To: devel at edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A
> Subject: [PATCH 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and
> RetEntry
>
> Entry and RetEntry might be NULL before used.
>
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang at intel.com>
> ---
> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c | 2 +-
> 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 8e305e4243a5..7b453fa98c2b 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 85cc275c114b..90a9b9fbd7ee 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 ;
> }
Reviewed-by: Hao A Wu <hao.a.wu at intel.com>
Best Regards,
Hao Wu
>
> --
> 2.18.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#49639): https://edk2.groups.io/g/devel/message/49639
Mute This Topic: https://groups.io/mt/34668863/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list