]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellProtocol.c
Fix dec file to pass new stricter error checking.
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellProtocol.c
index 392298989ee6dd7a943deb50453d8a1d09580eef..0f799786ee3fb28aa571a8d1a564d8c0b9154de7 100644 (file)
@@ -386,6 +386,7 @@ EfiShellGetFilePathFromDevicePath(
   EFI_HANDLE                      MapHandle;\r
   EFI_STATUS                      Status;\r
   FILEPATH_DEVICE_PATH            *FilePath;\r
+  FILEPATH_DEVICE_PATH            *AlignedNode;\r
 \r
   PathForReturn = NULL;\r
   PathSize = 0;\r
@@ -436,7 +437,10 @@ EfiShellGetFilePathFromDevicePath(
           //\r
           ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL));\r
           PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L"\\", 1);\r
-          PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, FilePath->PathName, 0);\r
+\r
+          AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePath), FilePath);\r
+          PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, AlignedNode->PathName, 0);\r
+          FreePool(AlignedNode);\r
         }\r
       } // for loop of remaining nodes\r
     }\r