summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
diff options
context:
space:
mode:
authorZhang, Chao B <chao.b.zhang@intel.com>2018-02-06 14:55:21 +0800
committerZhang, Chao B <chao.b.zhang@intel.com>2018-02-07 09:03:59 +0800
commit449083a3f897fd2e93355b8e0774bd3f63211b17 (patch)
tree8a191021991258736e4f59c9b858d06e0a03a8a2 /SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
parentc4e75574a0c7d3ef97be8e18f261298b34e77065 (diff)
downloadedk2-449083a3f897fd2e93355b8e0774bd3f63211b17.tar.gz
edk2-449083a3f897fd2e93355b8e0774bd3f63211b17.tar.bz2
edk2-449083a3f897fd2e93355b8e0774bd3f63211b17.zip
SecurityPkg:Tcg2Smm: Fix compile issue
Update Tcg2Smm _PRS patching logic to fix compile issue Cc: Liming Gao <liming.gao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c')
-rw-r--r--SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c7
1 files 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;