]> 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 c7a5769bf582196a4f05602defac402dd4ef69c9..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
@@ -393,7 +393,7 @@ InternalHstiRecordFeaturesVerified (
   UINT8                            *SecurityFeaturesVerified;\r
   EFI_STATUS                       Status;\r
 \r
-  Aip = InternalHstiFindAip (Role, ImplementationID, &Hsti, &HstiSize);\r
+  Aip = InternalHstiFindAip (Role, ImplementationID, (VOID **)&Hsti, &HstiSize);\r
   if (Aip == NULL) {\r
     return EFI_NOT_STARTED;\r
   }\r
@@ -518,7 +518,7 @@ InternalHstiRecordErrorString (
   UINTN                            Offset;\r
   EFI_STATUS                       Status;\r
 \r
-  Aip = InternalHstiFindAip (Role, ImplementationID, &Hsti, &HstiSize);\r
+  Aip = InternalHstiFindAip (Role, ImplementationID, (VOID **)&Hsti, &HstiSize);\r
   if (Aip == NULL) {\r
     return EFI_NOT_STARTED;\r
   }\r