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