MdeModulePkg DxeCore: Check Start consistently in CoreConvertPagesEx

Current check:
ASSERT (NumberOfPages);
ASSERT ((Start & EFI_PAGE_MASK) == 0);
ASSERT (End > Start) ;

if (NumberOfPages == 0 ||
    ((Start & EFI_PAGE_MASK) != 0) ||
    (Start > (Start + NumberOfBytes))) {

This patch is to update "(Start > (Start + NumberOfBytes))" to "(Start >= End)"
to be consistent with "ASSERT (End > Start)"

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Star Zeng 2016-03-18 09:46:24 +08:00
parent 6fe9d9c15b
commit f0459afe91
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file
UEFI Memory page management functions.
Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
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
@ -725,7 +725,7 @@ CoreConvertPagesEx (
ASSERT_LOCKED (&gMemoryLock);
ASSERT ( (ChangingType == FALSE) || (ChangingAttributes == FALSE) );
if (NumberOfPages == 0 || ((Start & EFI_PAGE_MASK) != 0) || (Start > (Start + NumberOfBytes))) {
if (NumberOfPages == 0 || ((Start & EFI_PAGE_MASK) != 0) || (Start >= End)) {
return EFI_INVALID_PARAMETER;
}