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:
xli24 2010-01-14 09:07:47 +00:00
parent 7e28c19670
commit 9c1d98d822
1 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/**@file
Copyright (c) 2006 - 2009, Intel Corporation
Copyright (c) 2006 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
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
@ -81,6 +81,10 @@ Returns:
return EFI_INVALID_PARAMETER;
}
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
return EFI_INVALID_PARAMETER;
}
Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
if (EFI_ERROR (Status)) {
return Status;
@ -135,6 +139,10 @@ Returns:
return EFI_INVALID_PARAMETER;
}
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
return EFI_INVALID_PARAMETER;
}
Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
if (EFI_ERROR (Status)) {
return Status;
@ -192,7 +200,7 @@ Returns:
Address = (UINTN) UserAddress;
if (Width >= EfiCpuIoWidthMaximum) {
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
return EFI_INVALID_PARAMETER;
}
@ -257,7 +265,7 @@ Returns:
Address = (UINTN) UserAddress;
if (Width >= EfiCpuIoWidthMaximum) {
if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
return EFI_INVALID_PARAMETER;
}