]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/TcgDxe/TcgDxe.c
SecurityPkg/TcgDxe: Refine to compare 2 values with the same type
[mirror_edk2.git] / SecurityPkg / Tcg / TcgDxe / TcgDxe.c
index f7bf79a66c57dfa7872f058b692f7e48e811485e..5b7c5c3e165bcf7643c303caad04019003d2d5f9 100644 (file)
@@ -8,7 +8,7 @@ buffer overflow, integer overflow.
 \r
 TcgDxePassThroughToTpm() will receive untrusted input and do basic validation.\r
 \r
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
@@ -395,7 +395,7 @@ TpmCommLogEvent (
   //\r
   // Prevent Event Overflow\r
   //\r
-  if (NewEventHdr->EventSize > (UINTN)(~0) - sizeof (*NewEventHdr)) {\r
+  if ((UINTN) NewEventHdr->EventSize > MAX_UINTN - sizeof (*NewEventHdr)) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r