diff options
author | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-02-06 14:55:21 +0800 |
---|---|---|
committer | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-03-22 10:43:39 +0800 |
commit | 4d44a34c1e4426ee9cce0a03e0eec1c058ec1008 (patch) | |
tree | 7fcf64d3c89975196cc3dcbde5a8467f90921959 | |
parent | 10dd7e4a1e48590f3f991a964efd4937adc11fa9 (diff) | |
download | edk2-4d44a34c1e4426ee9cce0a03e0eec1c058ec1008.tar.gz |
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>
(cherry picked from commit 449083a3f897fd2e93355b8e0774bd3f63211b17)
(cherry picked from commit abb0427276d323035832b869e53473d2412245f3)
(cherry picked from commit d207ef6f5a856d04ee175baf44e7e94a024d60a3)
-rw-r--r-- | SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c index ffd50f721e..03e6e52000 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -531,10 +531,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;
|