From 449083a3f897fd2e93355b8e0774bd3f63211b17 Mon Sep 17 00:00:00 2001 From: "Zhang, Chao B" Date: Tue, 6 Feb 2018 14:55:21 +0800 Subject: [PATCH] SecurityPkg:Tcg2Smm: Fix compile issue Update Tcg2Smm _PRS patching logic to fix compile issue Cc: Liming Gao Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang Reviewed-by: Liming Gao --- SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c index e3938cb8ec..6eb62ae64c 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -539,10 +539,11 @@ UpdatePossibleResource ( *(DataPtr + 1) = 0; // - // 5. Jump over whole ResourceTemplate. Stuff rest bytes to NOOP + // 5. Jump over new ResourceTemplate. Stuff rest bytes to NOOP // - for (DataPtr += 2; DataPtr < DataEndPtr; DataPtr++) { - *DataPtr = AML_NOOP_OP; + DataPtr += 2; + if (DataPtr < DataEndPtr) { + SetMem(DataPtr, (UINTN)(DataEndPtr - DataPtr), AML_NOOP_OP); } return EFI_SUCCESS;