From f50204289c84e0ece149ccc0b4f53bf7fbc1d894 Mon Sep 17 00:00:00 2001 From: jcarsey Date: Wed, 24 Nov 2010 16:12:11 +0000 Subject: fix unaligned device path node access. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11089 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/ShellProtocol.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ShellPkg') 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 } -- cgit v1.2.3