mirror of https://github.com/acidanthera/audk.git
SecurityPkg: Tcg2Smm: Refine type cast in pointer abstraction
Pointer subtraction is not performed by pointers to elements of the same array object. Such behavior is undefined by C11 standard and might lead to potential issues, Refine pointer subtraction by first casting each pointer to UINTN. Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
This commit is contained in:
parent
0c8b880223
commit
28fd7b090d
|
@ -543,7 +543,7 @@ UpdatePossibleResource (
|
|||
//
|
||||
DataPtr += 2;
|
||||
if (DataPtr < DataEndPtr) {
|
||||
SetMem(DataPtr, (UINTN)(DataEndPtr - DataPtr), AML_NOOP_OP);
|
||||
SetMem(DataPtr, (UINTN)DataEndPtr - (UINTN)DataPtr, AML_NOOP_OP);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue