summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/ReportStatusCodeRouter
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2020-04-09 06:11:59 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-04-21 02:20:51 +0000
commit7a7bedce25d257c1058d9a5212a3a0554c5d70a6 (patch)
treeb1e2f243f991de2bde3f0b15f4f00d7c3121dd95 /MdeModulePkg/Universal/ReportStatusCodeRouter
parentbe7295b36405d9029a0008f6bff0d5e19fb6209a (diff)
downloadedk2-7a7bedce25d257c1058d9a5212a3a0554c5d70a6.tar.gz
edk2-7a7bedce25d257c1058d9a5212a3a0554c5d70a6.tar.bz2
edk2-7a7bedce25d257c1058d9a5212a3a0554c5d70a6.zip
MdeModulePkg/ReportStatusCodeRouter: Clear RSC Data buffer if Data is NULL
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1969 ReportDispatcher() may be invoked with a NULL Data argument. When TPL is less than TPL_HIGH_LEVEL and Data is NULL, the EFI_STATUS_CODE_DATA structure inside RscData should be cleared so listeners will not receive data from a previous operation. 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>
Diffstat (limited to 'MdeModulePkg/Universal/ReportStatusCodeRouter')
-rw-r--r--MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
index 6ca7e180eb..5df83027c6 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
**/
@@ -307,6 +308,9 @@ ReportDispatcher (
}
if (Data != NULL) {
CopyMem (&RscData->Data, Data, Data->HeaderSize + Data->Size);
+ } else {
+ ZeroMem (&RscData->Data, sizeof (RscData->Data));
+ RscData->Data.HeaderSize = sizeof (RscData->Data);
}
Status = gBS->SignalEvent (CallbackEntry->Event);