public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Dimitrije Pavlov" <Dimitrije.Pavlov@arm.com>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Sunny Wang <Sunny.Wang@arm.com>,
	Jeff Booher-Kaeding <Jeff.Booher-Kaeding@arm.com>,
	Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Subject: [PATCH v2 1/3] OvmfPkg/PlatformDxe: Check ExtractConfig and RouteConfig arguments
Date: Mon, 15 Aug 2022 11:31:17 -0500	[thread overview]
Message-ID: <20220815163119.2877228-2-dimitrije.pavlov@arm.com> (raw)
In-Reply-To: <20220815163119.2877228-1-dimitrije.pavlov@arm.com>

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.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sunny Wang <Sunny.Wang@arm.com>
Cc: Jeff Booher-Kaeding <Jeff.Booher-Kaeding@arm.com>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

Signed-off-by: Dimitrije Pavlov <Dimitrije.Pavlov@arm.com>
---
 OvmfPkg/PlatformDxe/Platform.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
index 4bf22712c78f..d7be2ab65efa 100644
--- a/OvmfPkg/PlatformDxe/Platform.c
+++ b/OvmfPkg/PlatformDxe/Platform.c
@@ -232,6 +232,10 @@ ExtractConfig (
 
   DEBUG ((DEBUG_VERBOSE, "%a: Request=\"%s\"\n", __FUNCTION__, Request));
 
+  if (Progress == NULL || Results == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   Status = PlatformConfigToFormState (&MainFormState);
   if (EFI_ERROR (Status)) {
     *Progress = Request;
@@ -340,6 +344,10 @@ RouteConfig (
     Configuration
     ));
 
+  if (Progress == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   //
   // the "read" step in RMW
   //
-- 
2.37.2


  reply	other threads:[~2022-08-15 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 16:31 [PATCH v2 0/3] OvmfPkg: Check arguments for validity Dimitrije Pavlov
2022-08-15 16:31 ` Dimitrije Pavlov [this message]
2022-08-15 16:31 ` [PATCH v2 2/3] OvmfPkg/VirtioGpuDxe: Check QueryMode arguments Dimitrije Pavlov
2022-08-15 16:31 ` [PATCH v2 3/3] OvmfPkg/VirtioFsDxe: Check GetDriverName arguments Dimitrije Pavlov
2022-08-15 16:35 ` [PATCH v2 0/3] OvmfPkg: Check arguments for validity Ard Biesheuvel
2022-08-16 11:39 ` Sunny Wang
2022-08-16 19:14   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220815163119.2877228-2-dimitrije.pavlov@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox