]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/PlatformDxe: Check ExtractConfig and RouteConfig arguments
authorDimitrije Pavlov <dimitrije.pavlov@arm.com>
Tue, 16 Aug 2022 20:28:35 +0000 (15:28 -0500)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 16 Aug 2022 20:52:19 +0000 (20:52 +0000)
The current implementation does not check if Progress or Results
pointers in ExtractConfig are NULL, or if Progress pointer in
RouteConfig is NULL. This causes the SCT test suite to crash.

Add a check to return EFI_INVALID_PARAMETER if any of these pointers
are NULL.

Signed-off-by: Dimitrije Pavlov <Dimitrije.Pavlov@arm.com>
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
OvmfPkg/PlatformDxe/Platform.c

index 4bf22712c78f5e6b42b5fb74653e6d98a6639eeb..a6d459f3dfd7a9cbeda0dc3e4d327863c8cd8da0 100644 (file)
@@ -232,6 +232,10 @@ ExtractConfig (
 \r
   DEBUG ((DEBUG_VERBOSE, "%a: Request=\"%s\"\n", __FUNCTION__, Request));\r
 \r
+  if ((Progress == NULL) || (Results == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   Status = PlatformConfigToFormState (&MainFormState);\r
   if (EFI_ERROR (Status)) {\r
     *Progress = Request;\r
@@ -340,6 +344,10 @@ RouteConfig (
     Configuration\r
     ));\r
 \r
+  if (Progress == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   //\r
   // the "read" step in RMW\r
   //\r