mirror of https://github.com/acidanthera/audk.git
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:
parent
d7f791184b
commit
f50204289c
|
@ -386,6 +386,7 @@ EfiShellGetFilePathFromDevicePath(
|
||||||
EFI_HANDLE MapHandle;
|
EFI_HANDLE MapHandle;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
FILEPATH_DEVICE_PATH *FilePath;
|
FILEPATH_DEVICE_PATH *FilePath;
|
||||||
|
FILEPATH_DEVICE_PATH *AlignedNode;
|
||||||
|
|
||||||
PathForReturn = NULL;
|
PathForReturn = NULL;
|
||||||
PathSize = 0;
|
PathSize = 0;
|
||||||
|
@ -436,7 +437,10 @@ EfiShellGetFilePathFromDevicePath(
|
||||||
//
|
//
|
||||||
ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL));
|
ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL));
|
||||||
PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L"\\", 1);
|
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
|
} // for loop of remaining nodes
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue