mirror of https://github.com/acidanthera/audk.git
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:
parent
53fafef5c6
commit
91a306eee7
|
@ -147,7 +147,7 @@ GetDevicePath (
|
||||||
//
|
//
|
||||||
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DevicePathBuffer;
|
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DevicePathBuffer;
|
||||||
while (!IsDevicePathEnd (DevicePath)) {
|
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
|
// Invalid device path
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue