summaryrefslogtreecommitdiff
path: root/edk2/ShellPkg/Application
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
commit85d3138c95af514c2baede26b61a891b6f2c20c1 (patch)
treee15fc0d3c2d2b12c05b10658bc1ba563193017fe /edk2/ShellPkg/Application
parent8e7a92262943d131ba624971221092a7867e93fa (diff)
fix unaligned device path node access.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@11089 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'edk2/ShellPkg/Application')
-rw-r--r--edk2/ShellPkg/Application/Shell/ShellProtocol.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/edk2/ShellPkg/Application/Shell/ShellProtocol.c b/edk2/ShellPkg/Application/Shell/ShellProtocol.c
index 392298989..0f799786e 100644
--- a/edk2/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/edk2/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
}