1) Remove buffer overflow when the number of Driver Binding Protocols increases in...
[people/mcb30/edk2.git] / edk2 / MdeModulePkg / Core / Dxe / Image / ImageFile.c
index 029f7cf..31b1443 100644 (file)
@@ -30,7 +30,7 @@ CoreOpenImageFile (
   IN BOOLEAN                        BootPolicy,\r
   IN VOID                           *SourceBuffer   OPTIONAL,\r
   IN UINTN                          SourceSize,\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL   *FilePath,\r
+  IN EFI_DEVICE_PATH_PROTOCOL       *FilePath,\r
   OUT EFI_HANDLE                    *DeviceHandle,\r
   IN IMAGE_FILE_HANDLE              *ImageFileHandle,\r
   OUT UINT32                        *AuthenticationStatus\r
@@ -95,6 +95,7 @@ Returns:
     ImageFileHandle->Source     = SourceBuffer;\r
     ImageFileHandle->SourceSize = SourceSize;\r
     *DeviceHandle     = NULL;\r
+    CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &FilePath, DeviceHandle);\r
     if (SourceSize > 0) {\r
       Status = EFI_SUCCESS;\r
     } else {\r