From: Michael Kubacki <michael.kuba...@microsoft.com>

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

The RSC router data buffer may be reallocated when the buffer is nearing
exhaustion (7/8 portion of the buffer used).

While several pointers are updated to point to the newly allocated buffer,
the RscData is not updated. This commit updates the RSC data pointer
to the same offset in the reallocated data buffer.

Cc: Dandan Bi <dandan...@intel.com>
Cc: Hao A Wu <hao.a...@intel.com>
Cc: Jian J Wang <jian.j.w...@intel.com>
Cc: Kun Qin <kun....@microsoft.com>
Cc: Liming Gao <liming....@intel.com>
Signed-off-by: Michael Kubacki <michael.kuba...@microsoft.com>
---
 
MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
 | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
 
b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
index 6ca7e180ebb3..82fa2e025466 100644
--- 
a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
+++ 
b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
@@ -3,6 +3,7 @@
   and Status Code Runtime Protocol.
 
   Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -286,6 +287,7 @@ ReportDispatcher (
                       );
         if (NewBuffer != NULL) {
           CallbackEntry->EndPointer = (EFI_PHYSICAL_ADDRESS) (UINTN) NewBuffer 
+ (CallbackEntry->EndPointer - CallbackEntry->StatusCodeDataBuffer);
+          RscData = (RSC_DATA_ENTRY *) (UINTN) ((UINTN) NewBuffer + ((UINTN) 
RscData - CallbackEntry->StatusCodeDataBuffer));
           CallbackEntry->StatusCodeDataBuffer = (EFI_PHYSICAL_ADDRESS) (UINTN) 
NewBuffer;
           CallbackEntry->BufferSize *= 2;
         }
-- 
2.16.3.windows.1


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

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

Reply via email to