public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: [patch] MdePkg: Check input Ptrs in GetSectionFromAnyFvByFileType
Date: Mon, 19 Nov 2018 10:08:33 +0800	[thread overview]
Message-ID: <20181119020833.22748-2-dandan.bi@intel.com> (raw)
In-Reply-To: <20181119020833.22748-1-dandan.bi@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1337

In function GetSectionFromAnyFvByFileType, the input parameter "Buffer"
and "size" should not be NULL, so add ASSERT here to avoid any checker
report that the NULL pointer may be used.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdePkg/Library/DxeServicesLib/DxeServicesLib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
index d4f366425f..e78d51cb92 100644
--- a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
+++ b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
@@ -251,10 +251,13 @@ GetSectionFromAnyFvByFileType  (
   UINTN                         Key;
   EFI_GUID                      NameGuid;
   EFI_FV_FILE_ATTRIBUTES        Attributes;
   EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
 
+  ASSERT (Buffer != NULL);
+  ASSERT (Size != NULL);
+
   //
   // Locate all available FVs.
   //
   HandleBuffer = NULL;
   Status = gBS->LocateHandleBuffer (
-- 
2.18.0.windows.1



  reply	other threads:[~2018-11-19  2:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19  2:08 [patch] MdePkg: check Length para before use in DevPathToTextUsbWWID Dandan Bi
2018-11-19  2:08 ` Dandan Bi [this message]
2018-11-20  3:51   ` [patch] MdePkg: Check input Ptrs in GetSectionFromAnyFvByFileType Gao, Liming
2018-11-20  3:49 ` [patch] MdePkg: check Length para before use in DevPathToTextUsbWWID Gao, Liming

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=20181119020833.22748-2-dandan.bi@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