summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-24 16:12:11 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-24 16:12:11 +0000
commitf50204289c84e0ece149ccc0b4f53bf7fbc1d894 (patch)
tree9ad4efb99c111ca9e70c4aed9a028206b2d3a3c4 /ShellPkg
parentd7f791184ba3db719bc46c3f7b7e2557cc8f9e8c (diff)
downloadedk2-platforms-f50204289c84e0ece149ccc0b4f53bf7fbc1d894.tar.xz
fix unaligned device path node access.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11089 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index 392298989e..0f799786ee 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -386,6 +386,7 @@ EfiShellGetFilePathFromDevicePath(
EFI_HANDLE MapHandle;
EFI_STATUS Status;
FILEPATH_DEVICE_PATH *FilePath;
+ FILEPATH_DEVICE_PATH *AlignedNode;
PathForReturn = NULL;
PathSize = 0;
@@ -436,7 +437,10 @@ EfiShellGetFilePathFromDevicePath(
//
ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL));
PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L"\\", 1);
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, FilePath->PathName, 0);
+
+ AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePath), FilePath);
+ PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, AlignedNode->PathName, 0);
+ FreePool(AlignedNode);
}
} // for loop of remaining nodes
}