Correct the check to the valid device path. The device path can't be less than the basic header.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8381 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2009-05-26 01:49:53 +00:00
parent 53fafef5c6
commit 91a306eee7
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ GetDevicePath (
//
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DevicePathBuffer;
while (!IsDevicePathEnd (DevicePath)) {
if ((DevicePath->Type == 0) || (DevicePath->SubType == 0) || (DevicePathNodeLength (DevicePath) > sizeof (EFI_DEV_PATH))) {
if ((DevicePath->Type == 0) || (DevicePath->SubType == 0) || (DevicePathNodeLength (DevicePath) < sizeof (EFI_DEVICE_PATH_PROTOCOL))) {
//
// Invalid device path
//