From: Marvin Haeuser <mhaeu...@outlook.de>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2294

EFI_RUNTIME_SERVICES.GetTime() might return an unspecified Timezone,
such as when SetTime() has not been called after the RTC was cut off
power. Consider this case by not attempting Timezone translations for
when it is invalid.

Cc: Ray Ni <ray...@intel.com>
Cc: Zhichao Gao <zhichao....@intel.com>
Signed-off-by: Marvin Haeuser <mhaeu...@outlook.de>
---
 ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c 
b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
index adeb987e6ecb..1a65f60c3b44 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
@@ -500,7 +500,7 @@ PrintLsOutput(
       // Change the file time to local time.

       //

       Status = gRT->GetTime(&LocalTime, NULL);

-      if (!EFI_ERROR (Status)) {

+      if (!EFI_ERROR (Status) && (LocalTime.TimeZone != 
EFI_UNSPECIFIED_TIMEZONE)) {

         if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) &&

             (Node->Info->CreateTime.Month >= 1 && Node->Info->CreateTime.Month 
<= 12)) {

           //

-- 
2.23.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49257): https://edk2.groups.io/g/devel/message/49257
Mute This Topic: https://groups.io/mt/35954829/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to