fix unaligned device path node access.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11089 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2010-11-24 16:12:11 +00:00
parent d7f791184b
commit f50204289c
1 changed files with 5 additions and 1 deletions

View File

@ -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
}