Add in parameter checking to pass UEFI HII SCT test.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6567 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2008-11-17 14:30:47 +00:00
parent d9304888c5
commit 6a179dcaee
1 changed files with 18 additions and 0 deletions

View File

@ -403,11 +403,20 @@ ThunkExtractConfig (
VOID *Data; VOID *Data;
UINTN DataSize; UINTN DataSize;
if (Request == NULL) {
return EFI_NOT_FOUND;
}
Data = NULL; Data = NULL;
ConfigAccess = CONFIG_ACCESS_PRIVATE_FROM_PROTOCOL (This); ConfigAccess = CONFIG_ACCESS_PRIVATE_FROM_PROTOCOL (This);
BufferStorage = GetStorageFromConfigString (ConfigAccess->ThunkContext->FormSet, Request); BufferStorage = GetStorageFromConfigString (ConfigAccess->ThunkContext->FormSet, Request);
if (BufferStorage == NULL) {
*Progress = (EFI_STRING) Request;
return EFI_NOT_FOUND;
}
if (ConfigAccess->ThunkContext->NvMapOverride == NULL) { if (ConfigAccess->ThunkContext->NvMapOverride == NULL) {
// //
// NvMapOverride is not used. Get the Storage data from EFI Variable or Framework Form Callback. // NvMapOverride is not used. Get the Storage data from EFI Variable or Framework Form Callback.
@ -491,11 +500,20 @@ ThunkRouteConfig (
BOOLEAN ResetRequired; BOOLEAN ResetRequired;
BOOLEAN DataAllocated; BOOLEAN DataAllocated;
if (Configuration == NULL) {
return EFI_INVALID_PARAMETER;
}
Data = NULL; Data = NULL;
ConfigAccess = CONFIG_ACCESS_PRIVATE_FROM_PROTOCOL (This); ConfigAccess = CONFIG_ACCESS_PRIVATE_FROM_PROTOCOL (This);
BufferStorage = GetStorageFromConfigString (ConfigAccess->ThunkContext->FormSet, Configuration); BufferStorage = GetStorageFromConfigString (ConfigAccess->ThunkContext->FormSet, Configuration);
if (BufferStorage == NULL) {
*Progress = Configuration;
return EFI_NOT_FOUND;
}
DataSize2 = BufferStorage->Size; DataSize2 = BufferStorage->Size;
if (ConfigAccess->ThunkContext->NvMapOverride == NULL) { if (ConfigAccess->ThunkContext->NvMapOverride == NULL) {
DataAllocated = TRUE; DataAllocated = TRUE;