Add legacy region range check.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9549 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24 2009-12-10 09:24:40 +00:00
parent d90434ccb5
commit 601afc0356
1 changed files with 16 additions and 0 deletions

View File

@ -64,6 +64,10 @@ LegacyRegion2Decode (
IN BOOLEAN *On
)
{
if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
return EFI_INVALID_PARAMETER;
}
ASSERT (Granularity != NULL);
*Granularity = 0;
return EFI_SUCCESS;
@ -98,6 +102,10 @@ LegacyRegion2Lock (
OUT UINT32 *Granularity
)
{
if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
return EFI_INVALID_PARAMETER;
}
ASSERT (Granularity != NULL);
*Granularity = 0;
return EFI_SUCCESS;
@ -137,6 +145,10 @@ LegacyRegion2BootLock (
OUT UINT32 *Granularity
)
{
if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
return EFI_INVALID_PARAMETER;
}
ASSERT (Granularity != NULL);
*Granularity = 0;
return EFI_SUCCESS;
@ -171,6 +183,10 @@ LegacyRegion2Unlock (
OUT UINT32 *Granularity
)
{
if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) {
return EFI_INVALID_PARAMETER;
}
ASSERT (Granularity != NULL);
*Granularity = 0;
return EFI_SUCCESS;