From 6a179dcaee63eec3fba37ffd6459459190a57aaf Mon Sep 17 00:00:00 2001 From: qwang12 Date: Mon, 17 Nov 2008 14:30:47 +0000 Subject: [PATCH] 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 --- .../FrameworkHiiToUefiHiiThunk/ConfigAccess.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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;