Refine code to make code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10880 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -490,7 +490,8 @@ CoreLocateDevicePath (
|
||||
// Check if DevicePath is first part of SourcePath
|
||||
//
|
||||
Size = GetDevicePathSize (TmpDevicePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
|
||||
if ((Size <= SourceSize) && CompareMem (SourcePath, TmpDevicePath, Size) == 0) {
|
||||
ASSERT (Size >= 0);
|
||||
if ((Size <= SourceSize) && CompareMem (SourcePath, TmpDevicePath, (UINTN) Size) == 0) {
|
||||
//
|
||||
// If the size is equal to the best match, then we
|
||||
// have a duplicate device path for 2 different device
|
||||
|
Reference in New Issue
Block a user