]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeHstiLib/HstiDxe.c
Resolve buffer check overrun issue.
[mirror_edk2.git] / MdePkg / Library / DxeHstiLib / HstiDxe.c
index d5d75749874382c7f82dd657e67a299408cfa259..114a76752607f0896917ceeb5447308dcdb80c72 100644 (file)
@@ -200,12 +200,12 @@ InternalHstiIsValidTable (
   //\r
   // Check ImplementationID\r
   //\r
-  for (Index = 0; Index < sizeof(Hsti->ImplementationID); Index++) {\r
+  for (Index = 0; Index < sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0]); Index++) {\r
     if (Hsti->ImplementationID[Index] == 0) {\r
       break;\r
     }\r
   }\r
-  if (Index == sizeof(Hsti->ImplementationID)) {\r
+  if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) {\r
     DEBUG ((EFI_D_ERROR, "ImplementationID is no NUL CHAR\n"));\r
     return FALSE;\r
   }\r