]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData
authorDandan Bi <dandan.bi@intel.com>
Tue, 28 May 2019 02:25:09 +0000 (19:25 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Wed, 12 Jun 2019 16:23:30 +0000 (09:23 -0700)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1498

This patch fix following bugs in func DisplaySysEventLogData:
1. Log increment (Log = (LOG_RECORD_FORMAT *) (LogData + Offset);)
should happened in the end of while loop, not in the very beginning.
2. DisplaySELTypes function should be used in while loop instead of
DisplaySELVarDataFormatType.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c

index b8adf438d3a6d034e0413ab38a177dcc0ff491c9..984c17889059e01d6046517c264e58b0a814b3f1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Module for clarifying the content of the smbios structure element info.\r
 \r
 /** @file\r
   Module for clarifying the content of the smbios structure element info.\r
 \r
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved. <BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -347,16 +347,12 @@ DisplaySysEventLogData (
   Offset  = 0;\r
   Log     = (LOG_RECORD_FORMAT *) LogData;\r
   while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) {\r
   Offset  = 0;\r
   Log     = (LOG_RECORD_FORMAT *) LogData;\r
   while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) {\r
-    //\r
-    // Get a Event Log Record\r
-    //\r
-    Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
 \r
     if (Log != NULL) {\r
       //\r
       // Display Event Log Record Information\r
       //\r
 \r
     if (Log != NULL) {\r
       //\r
       // Display Event Log Record Information\r
       //\r
-      DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL);\r
+      DisplaySELTypes (Log->Type, SHOW_DETAIL);\r
       DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL);\r
 \r
       Offset += Log->Length;\r
       DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL);\r
 \r
       Offset += Log->Length;\r
@@ -373,6 +369,10 @@ DisplaySysEventLogData (
         Print (L"20");\r
       } else {\r
         ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);\r
         Print (L"20");\r
       } else {\r
         ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);\r
+        //\r
+        // Get a Event Log Record\r
+        //\r
+        Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
         continue;\r
       }\r
 \r
         continue;\r
       }\r
 \r
@@ -391,11 +391,19 @@ DisplaySysEventLogData (
       // Display Variable Data Format\r
       //\r
       if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) {\r
       // Display Variable Data Format\r
       //\r
       if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) {\r
+        //\r
+        // Get a Event Log Record\r
+        //\r
+        Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
         continue;\r
       }\r
 \r
       ElVdfType = Log->LogVariableData[0];\r
       DisplayElVdfInfo (ElVdfType, Log->LogVariableData);\r
         continue;\r
       }\r
 \r
       ElVdfType = Log->LogVariableData[0];\r
       DisplayElVdfInfo (ElVdfType, Log->LogVariableData);\r
+      //\r
+      // Get a Event Log Record\r
+      //\r
+      Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
     }\r
   }\r
 }\r
     }\r
   }\r
 }\r