diff options
author | Liming Gao <liming.gao@intel.com> | 2016-08-02 13:37:55 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2016-08-03 15:20:50 +0800 |
commit | deaacda3b2740477733564066eb69d5c94b41bba (patch) | |
tree | 22aa003bda30a46dd66f7bc8754ab35032b6d736 /MdeModulePkg/Universal/LoadFileOnFv2 | |
parent | b40ad7b54d1dbdded77f779fa4d1dbe860783c8e (diff) | |
download | edk2-deaacda3b2740477733564066eb69d5c94b41bba.tar.gz edk2-deaacda3b2740477733564066eb69d5c94b41bba.tar.bz2 edk2-deaacda3b2740477733564066eb69d5c94b41bba.zip |
MdeModulePkg LoadFileOnFv2: Fix the potential NULL pointer access
Check NULL pointer before access it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/LoadFileOnFv2')
-rw-r--r-- | MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c index 9eea50dd33..18a07d86b7 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,
|