From: Liming Gao <liming.gao@intel.com>
To: edk2-devel@lists.01.org
Subject: [Patch] MdeModulePkg LoadFileOnFv2: Fix the potential NULL pointer access
Date: Tue, 2 Aug 2016 13:38:38 +0800 [thread overview]
Message-ID: <1470116318-5600-1-git-send-email-liming.gao@intel.com> (raw)
Check NULL pointer before access it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c
index 9eea50d..18a07d8 100644
--- a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c
+++ b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c
@@ -345,6 +345,9 @@ FvNotificationEvent (
Index = 0;
BufferSize = sizeof (EFI_HANDLE);
Handle = AllocateZeroPool (BufferSize);
+ if (Handle == NULL) {
+ return;
+ }
Status = gBS->LocateHandle (
ByProtocol,
&gEfiFirmwareVolume2ProtocolGuid,
@@ -355,6 +358,9 @@ FvNotificationEvent (
if (EFI_BUFFER_TOO_SMALL == Status) {
FreePool (Handle);
Handle = AllocateZeroPool (BufferSize);
+ if (Handle == NULL) {
+ return;
+ }
Status = gBS->LocateHandle (
ByProtocol,
&gEfiFirmwareVolume2ProtocolGuid,
--
2.8.0.windows.1
next reply other threads:[~2016-08-02 5:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 5:38 Liming Gao [this message]
2016-08-02 7:11 ` [Patch] MdeModulePkg LoadFileOnFv2: Fix the potential NULL pointer access Tian, Feng
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=1470116318-5600-1-git-send-email-liming.gao@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