]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg DxeHstiLib: Fix ErrorString pointer incorrectly calculated
authorStar Zeng <star.zeng@intel.com>
Wed, 11 Apr 2018 06:18:38 +0000 (14:18 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 13 Apr 2018 04:46:24 +0000 (12:46 +0800)
Fix ErrorString pointer is incorrectly calculated in
InternalHstiIsValidTable().

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdePkg/Library/DxeHstiLib/HstiDxe.c

index 58510766bb43426af4036456ad4beee00bbbd9ad..d08d8def0cb5fdf3b91a84720cd189faf6fd556a 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
 /** @file\r
 \r
-  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -211,7 +211,7 @@ InternalHstiIsValidTable (
   }\r
 \r
   ErrorStringSize = HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3;\r
   }\r
 \r
   ErrorStringSize = HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3;\r
-  ErrorString = (CHAR16 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3);\r
+  ErrorString = (CHAR16 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 3);\r
 \r
   //\r
   // basic check for ErrorString\r
 \r
   //\r
   // basic check for ErrorString\r