public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Hao Wu <hao.a.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Hao Wu <hao.a.wu@intel.com>, Star Zeng <star.zeng@intel.com>
Subject: [PATCH 2/2] ShellPkg/UefiDpLib: Add check to avoid NULL pointer dereference
Date: Mon, 27 Feb 2017 09:38:36 +0800	[thread overview]
Message-ID: <1488159516-8864-3-git-send-email-hao.a.wu@intel.com> (raw)
In-Reply-To: <1488159516-8864-1-git-send-email-hao.a.wu@intel.com>

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 ShellPkg/Library/UefiDpLib/Dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiDpLib/Dp.c b/ShellPkg/Library/UefiDpLib/Dp.c
index 33f69a0..35ead75 100644
--- a/ShellPkg/Library/UefiDpLib/Dp.c
+++ b/ShellPkg/Library/UefiDpLib/Dp.c
@@ -272,7 +272,7 @@ ShellCommandRunDp (
   //      EndCount = Value counter counts to before it needs to be reset
   //
   Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (VOID **) &PerformanceProperty);
-  if (EFI_ERROR (Status)) {
+  if (EFI_ERROR (Status) || (PerformanceProperty == NULL)) {
     ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PERF_PROPERTY_NOT_FOUND), gDpHiiHandle);
     goto Done;
   }
-- 
1.9.5.msysgit.0



  parent reply	other threads:[~2017-02-27  1:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27  1:38 [PATCH 0/2] Dp: Add check to avoid NULL pointer dereference Hao Wu
2017-02-27  1:38 ` [PATCH 1/2] PerformancePkg/Dp_App: " Hao Wu
2017-02-27  1:38 ` Hao Wu [this message]
2017-02-27  1:39 ` [PATCH 0/2] Dp: " Zeng, Star

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488159516-8864-3-git-send-email-hao.a.wu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox