summaryrefslogtreecommitdiffstats
path: root/SecurityPkg
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-01-06 16:10:09 +0800
committerHao Wu <hao.a.wu@intel.com>2017-01-12 21:26:28 +0800
commitb35ace177744dbb004201cc306aa3be3d435bf9a (patch)
tree8464d785e99b01f844f265d117238c743695696c /SecurityPkg
parent51dee9a4b411573687c85be075c012859486d96f (diff)
downloadedk2-b35ace177744dbb004201cc306aa3be3d435bf9a.tar.gz
edk2-b35ace177744dbb004201cc306aa3be3d435bf9a.tar.bz2
edk2-b35ace177744dbb004201cc306aa3be3d435bf9a.zip
SecurityPkg/TcgDxe: Refine to compare 2 values with the same type
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'SecurityPkg')
-rw-r--r--SecurityPkg/Tcg/TcgDxe/TcgDxe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
index f7bf79a66c..5b7c5c3e16 100644
--- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
+++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
@@ -8,7 +8,7 @@ buffer overflow, integer overflow.
TcgDxePassThroughToTpm() will receive untrusted input and do basic validation.
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -395,7 +395,7 @@ TpmCommLogEvent (
//
// Prevent Event Overflow
//
- if (NewEventHdr->EventSize > (UINTN)(~0) - sizeof (*NewEventHdr)) {
+ if ((UINTN) NewEventHdr->EventSize > MAX_UINTN - sizeof (*NewEventHdr)) {
return EFI_OUT_OF_RESOURCES;
}