]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Ppi/Ppi.c
MdeModulePkg: Fix use-after-free error in InstallConfigurationTable()
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Ppi / Ppi.c
index 9fe95acb86d3e34f5c7fcf59c12cdefb07c624c1..db6eded6d6eddd4cf0cdb21402148abdbec1c27f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI PEI Core PPI services\r
   \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -30,9 +30,9 @@ InitializePpiServices (
   )\r
 {\r
   if (OldCoreData == NULL) {\r
-    PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
-    PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
-    PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.NotifyListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.DispatchListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.LastDispatchedNotify = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
   }\r
 }\r
 \r
@@ -48,7 +48,7 @@ InitializePpiServices (
 \r
 **/\r
 VOID\r
-ConverSinglePpiPointer (\r
+ConvertSinglePpiPointer (\r
   IN PEI_PPI_LIST_POINTERS *PpiPointer,\r
   IN UINTN                 TempBottom,\r
   IN UINTN                 TempTop,\r
@@ -119,12 +119,12 @@ ConvertPpiPointers (
   UINT8                 Index;\r
   UINT8                 IndexHole;\r
 \r
-  for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {\r
+  for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {\r
     if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) {\r
       //\r
       // Convert PPI pointer in old Heap\r
       //\r
-      ConverSinglePpiPointer (\r
+      ConvertSinglePpiPointer (\r
         &PrivateData->PpiData.PpiListPtrs[Index],\r
         (UINTN)SecCoreData->PeiTemporaryRamBase,\r
         (UINTN)SecCoreData->PeiTemporaryRamBase + SecCoreData->PeiTemporaryRamSize,\r
@@ -135,7 +135,7 @@ ConvertPpiPointers (
       //\r
       // Convert PPI pointer in old Stack\r
       //\r
-      ConverSinglePpiPointer (\r
+      ConvertSinglePpiPointer (\r
         &PrivateData->PpiData.PpiListPtrs[Index],\r
         (UINTN)SecCoreData->StackBase,\r
         (UINTN)SecCoreData->StackBase + SecCoreData->StackSize,\r
@@ -151,7 +151,7 @@ ConvertPpiPointers (
           continue;\r
         }\r
         \r
-        ConverSinglePpiPointer (\r
+        ConvertSinglePpiPointer (\r
           &PrivateData->PpiData.PpiListPtrs[Index],\r
           (UINTN)PrivateData->HoleData[IndexHole].Base,\r
           (UINTN)PrivateData->HoleData[IndexHole].Base + PrivateData->HoleData[IndexHole].Size,\r
@@ -312,7 +312,7 @@ PeiReInstallPpi (
   // Remove the old PPI from the database, add the new one.\r
   //\r
   DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid));\r
-  ASSERT (Index < (INTN)(FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)));\r
+  ASSERT (Index < (INTN)(PcdGet32 (PcdPeiCoreMaxPpiSupported)));\r
   PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi;\r
 \r
   //\r
@@ -570,7 +570,7 @@ ProcessNotifyList (
         EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH,\r
         PrivateData->PpiData.LastDispatchedInstall,\r
         PrivateData->PpiData.PpiListEnd,\r
-        FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1,\r
+        PcdGet32 (PcdPeiCoreMaxPpiSupported)-1,\r
         PrivateData->PpiData.DispatchListEnd\r
         );\r
       PrivateData->PpiData.LastDispatchedInstall = TempValue;\r