mirror of https://github.com/acidanthera/audk.git
Fix parameter checking for CPU I/O 2 Protocol on NT32 platform.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9750 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7e28c19670
commit
9c1d98d822
|
@ -1,6 +1,6 @@
|
||||||
/**@file
|
/**@file
|
||||||
|
|
||||||
Copyright (c) 2006 - 2009, Intel Corporation
|
Copyright (c) 2006 - 2010, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -81,6 +81,10 @@ Returns:
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
|
Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -135,6 +139,10 @@ Returns:
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
|
Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -192,7 +200,7 @@ Returns:
|
||||||
|
|
||||||
Address = (UINTN) UserAddress;
|
Address = (UINTN) UserAddress;
|
||||||
|
|
||||||
if (Width >= EfiCpuIoWidthMaximum) {
|
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +265,7 @@ Returns:
|
||||||
|
|
||||||
Address = (UINTN) UserAddress;
|
Address = (UINTN) UserAddress;
|
||||||
|
|
||||||
if (Width >= EfiCpuIoWidthMaximum) {
|
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue