From 57ce74ac5ff4950b4bebd5bb1d8fa2024ecc1010 Mon Sep 17 00:00:00 2001 From: "Yao, Jiewen" Date: Thu, 22 Jan 2015 03:29:17 +0000 Subject: [PATCH] Resolve buffer check overrun issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" Reviewed-by: "Qiu, Shumin" git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16637 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/DxeHstiLib/HstiDxe.c | 4 ++-- 1 file 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; } -- 2.39.2