]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/ReportStatusCodeRouter: Take HeaderSize into Consideration
authorMichael Kubacki <michael.kubacki@microsoft.com>
Wed, 8 Apr 2020 21:45:28 +0000 (05:45 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 21 Apr 2020 02:20:51 +0000 (02:20 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2669

Updates ReportDispatcher() to take the size in the HeaderSize field in
a EFI_STATUS_CODE_DATA element into account when walking the data buffer.
This size will cause the header size to differ from the compiled sizeof
header.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Kun Qin <Kun.Qin@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c

index 27939235dc004c310eadc473c558e853ce11331b..2037c2fad05eafe8a292fbaf651607618a7dd3e5 100644 (file)
@@ -65,7 +65,7 @@ RscHandlerNotification (
                      &RscData->Data\r
                      );\r
 \r
-    Address += (sizeof (RSC_DATA_ENTRY) + RscData->Data.Size);\r
+    Address += (OFFSET_OF (RSC_DATA_ENTRY, Data) + RscData->Data.HeaderSize + RscData->Data.Size);\r
     Address  = ALIGN_VARIABLE (Address);\r
   }\r
 \r
@@ -274,7 +274,7 @@ ReportDispatcher (
     RscData = (RSC_DATA_ENTRY *) (UINTN) CallbackEntry->EndPointer;\r
     CallbackEntry->EndPointer += sizeof (RSC_DATA_ENTRY);\r
     if (Data != NULL) {\r
-      CallbackEntry->EndPointer += Data->Size;\r
+      CallbackEntry->EndPointer += (Data->Size + Data->HeaderSize - sizeof (EFI_STATUS_CODE_DATA));\r
     }\r
 \r
     //\r