From 00ccd99d46068c87e73e8e521afea09e19419885 Mon Sep 17 00:00:00 2001 From: Bret Barkelew Date: Mon, 29 Jul 2024 21:34:36 -0700 Subject: FatPkg: Fix potentially uninitialized variable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1559 Initializes the variable to prevent an uninitialized variable warning in Visual Studio with C4701 enabled. Signed-off-by: Michael Kubacki --- FatPkg/EnhancedFatDxe/Info.c | 2 ++ FatPkg/FatPei/FatLiteApi.c | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'FatPkg') diff --git a/FatPkg/EnhancedFatDxe/Info.c b/FatPkg/EnhancedFatDxe/Info.c index d17ce5b7ee..ab06311965 100644 --- a/FatPkg/EnhancedFatDxe/Info.c +++ b/FatPkg/EnhancedFatDxe/Info.c @@ -303,6 +303,8 @@ FatSetFileInfo ( UINT8 NewAttribute; BOOLEAN ReadOnly; + TempDirEnt = NULL; + ZeroMem (&ZeroTime, sizeof (EFI_TIME)); Parent = OFile->Parent; DirEnt = OFile->DirEnt; diff --git a/FatPkg/FatPei/FatLiteApi.c b/FatPkg/FatPei/FatLiteApi.c index b89ab7009d..49214a21b4 100644 --- a/FatPkg/FatPei/FatLiteApi.c +++ b/FatPkg/FatPei/FatLiteApi.c @@ -426,6 +426,8 @@ GetRecoveryCapsuleInfo ( PEI_FILE_HANDLE Handle; UINTN NumberRecoveryCapsules; + Handle = NULL; + Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules); if (EFI_ERROR (Status)) { @@ -551,6 +553,8 @@ LoadRecoveryCapsule ( PEI_FILE_HANDLE Handle; UINTN NumberRecoveryCapsules; + Handle = NULL; + Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules); if (EFI_ERROR (Status)) { -- cgit