During UEFI SCT, it will throw an exception because "Progress" is
passed in with NULL and RouteConfig will try to access the string at
*(EFI_STRING *0), i.e. 0xFFFFFFFF14000400.

Add sanity check for ExtractConfig and RouteConfig to avoid NULL
pointer dereference.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi....@linaro.org>
---
 OvmfPkg/PlatformDxe/Platform.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
index 4ec327e..35fabf8 100644
--- a/OvmfPkg/PlatformDxe/Platform.c
+++ b/OvmfPkg/PlatformDxe/Platform.c
@@ -234,6 +234,11 @@ ExtractConfig (
   MAIN_FORM_STATE MainFormState;
   EFI_STATUS      Status;
 
+  if (Progress == NULL || Results == NULL)
+  {
+    return EFI_INVALID_PARAMETER;
+  }
+
   DEBUG ((EFI_D_VERBOSE, "%a: Request=\"%s\"\n", __FUNCTION__, Request));
 
   Status = PlatformConfigToFormState (&MainFormState);
@@ -327,6 +332,11 @@ RouteConfig (
   UINTN           BlockSize;
   EFI_STATUS      Status;
 
+  if (Configuration == NULL || Progress == NULL)
+  {
+    return EFI_INVALID_PARAMETER;
+  }
+
   DEBUG ((EFI_D_VERBOSE, "%a: Configuration=\"%s\"\n", __FUNCTION__,
     Configuration));
 
-- 
2.1.4


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to