]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
Add code check to avoid access violation.
[mirror_edk2.git] / MdePkg / Library / PeiExtractGuidedSectionLib / PeiExtractGuidedSectionLib.c
index 1fad3d0c478f1e45e0ce43ae7a243ff26226d769..ffb11273bd9287e2d395d4e98a533ca3abf1846a 100644 (file)
@@ -156,6 +156,7 @@ ExtractGuidedSectionGetGuidList (
   //\r
   // Get GuidTable and Table Number\r
   //\r
+  ASSERT (HandlerInfo != NULL);\r
   *ExtractHandlerGuidTable = HandlerInfo->ExtractHandlerGuidTable;\r
   return HandlerInfo->NumberOfExtractHandler;\r
 }\r
@@ -216,6 +217,7 @@ ExtractGuidedSectionRegisterHandlers (
   //\r
   // Search the match registered GetInfo handler for the input guided section.\r
   //\r
+  ASSERT (HandlerInfo != NULL);\r
   for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
     if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {\r
       //\r
@@ -317,6 +319,7 @@ ExtractGuidedSectionGetInfo (
   //\r
   // Search the match registered GetInfo handler for the input guided section.\r
   //\r
+  ASSERT (HandlerInfo != NULL);\r
   for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
     if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {\r
       //\r
@@ -410,6 +413,7 @@ ExtractGuidedSectionDecode (
   //\r
   // Search the match registered Extract handler for the input guided section.\r
   //\r
+  ASSERT (HandlerInfo != NULL);\r
   for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
     if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {\r
       //\r