summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao, Jiewen <jiewen.yao@intel.com>2015-01-22 03:29:17 +0000
committerjyao1 <jyao1@Edk2>2015-01-22 03:29:17 +0000
commit57ce74ac5ff4950b4bebd5bb1d8fa2024ecc1010 (patch)
tree535ce607ecc20084543e20ea0e1bd3c5ede22c88
parenta61b07f464f5f9080ead9cc955f10f2acf5de085 (diff)
downloadedk2-platforms-57ce74ac5ff4950b4bebd5bb1d8fa2024ecc1010.tar.xz
Resolve buffer check overrun issue.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Qiu, Shumin" <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16637 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdePkg/Library/DxeHstiLib/HstiDxe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c
index d5d7574987..114a767526 100644
--- a/MdePkg/Library/DxeHstiLib/HstiDxe.c
+++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c
@@ -200,12 +200,12 @@ InternalHstiIsValidTable (
//
// Check ImplementationID
//
- for (Index = 0; Index < sizeof(Hsti->ImplementationID); Index++) {
+ for (Index = 0; Index < sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0]); Index++) {
if (Hsti->ImplementationID[Index] == 0) {
break;
}
}
- if (Index == sizeof(Hsti->ImplementationID)) {
+ if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) {
DEBUG ((EFI_D_ERROR, "ImplementationID is no NUL CHAR\n"));
return FALSE;
}