ShellPkg: Fix conditionally uninitialized variables
Fixes CodeQL alerts for CWE-457: https://cwe.mitre.org/data/definitions/457.html Cc: Erich McMillan <emcmillan@microsoft.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Co-authored-by: Erich McMillan <emcmillan@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
This commit is contained in:
committed by
mergify[bot]
parent
7dc182ed1e
commit
11dd44dfbe
@ -112,10 +112,13 @@ ShellCommandRunEfiDecompress (
|
||||
|
||||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
Status = FileHandleGetSize (InFileHandle, &Temp64Bit);
|
||||
ASSERT (Temp64Bit <= (UINT32)(-1));
|
||||
InSize = (UINTN)Temp64Bit;
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
InBuffer = AllocateZeroPool (InSize);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ASSERT (Temp64Bit <= (UINT32)(-1));
|
||||
InSize = (UINTN)Temp64Bit;
|
||||
InBuffer = AllocateZeroPool (InSize);
|
||||
}
|
||||
|
||||
if (InBuffer == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user