mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/PiSmmCore: add API parameter check
The Heap Guard feature wrapped SmmInternalFreePagesEx with SmmInternalFreePagesExWithGuard but didn't add necessary parameter check. This patch fixes this situation. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
a012bf6e3e
commit
7823611cda
|
@ -1205,6 +1205,10 @@ SmmInternalFreePagesExWithGuard (
|
|||
EFI_PHYSICAL_ADDRESS MemoryToFree;
|
||||
UINTN PagesToFree;
|
||||
|
||||
if (((Memory & EFI_PAGE_MASK) != 0) || (Memory == 0) || (NumberOfPages == 0)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
MemoryToFree = Memory;
|
||||
PagesToFree = NumberOfPages;
|
||||
|
||||
|
|
Loading…
Reference in New Issue