summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKun Qin <kuqin@microsoft.com>2020-03-18 14:12:27 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-05-06 03:04:17 +0000
commit55d6e39f72ba2003ef59aac91af34e96a09060db (patch)
tree59ad9a310ec8acdf69bbbc3126cb0f8473f06b6e
parent8dd962a657b28d9db65ed7a35817a4b82f06301a (diff)
downloadedk2-55d6e39f72ba2003ef59aac91af34e96a09060db.tar.gz
edk2-55d6e39f72ba2003ef59aac91af34e96a09060db.tar.bz2
edk2-55d6e39f72ba2003ef59aac91af34e96a09060db.zip
FmpDevicePkg/FmpDxe: Fix uninitialized pointer dereference
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2602 Zero the allocated buffer in case GetImageInfo `continue` in the middle of a loop. This will cause unexpected GetImageInfo failure not clearing the corresponding entry and lead to GP faults when dereferencing this entry. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
-rw-r--r--FmpDevicePkg/FmpDxe/Dependency.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/FmpDevicePkg/FmpDxe/Dependency.c b/FmpDevicePkg/FmpDxe/Dependency.c
index 8f97c42916..65c23989c6 100644
--- a/FmpDevicePkg/FmpDxe/Dependency.c
+++ b/FmpDevicePkg/FmpDxe/Dependency.c
@@ -552,7 +552,7 @@ EvaluateImageDependencies (
return EFI_ABORTED;
}
- mFmpImageInfoBuf = AllocatePool (sizeof(EFI_FIRMWARE_IMAGE_DESCRIPTOR *) * mNumberOfFmpInstance);
+ mFmpImageInfoBuf = AllocateZeroPool (sizeof(EFI_FIRMWARE_IMAGE_DESCRIPTOR *) * mNumberOfFmpInstance);
if (mFmpImageInfoBuf == NULL) {
return EFI_OUT_OF_RESOURCES;
}