From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.20860.1660681724844959406 for ; Tue, 16 Aug 2022 13:28:44 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: dimitrije.pavlov@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0FD32113E; Tue, 16 Aug 2022 13:28:44 -0700 (PDT) Received: from mammon-apollo-f36.austin.arm.com (mammon-apollo-f36.austin.arm.com [10.118.12.61]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DDA53F7D7; Tue, 16 Aug 2022 13:28:43 -0700 (PDT) From: "Dimitrije Pavlov" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Liming Gao , Sunny Wang , Jeff Booher-Kaeding , Samer El-Haj-Mahmoud , Sunny Wang Subject: [PATCH v3 1/3] OvmfPkg/PlatformDxe: Check ExtractConfig and RouteConfig arguments Date: Tue, 16 Aug 2022 15:28:35 -0500 Message-Id: <20220816202837.3257608-2-dimitrije.pavlov@arm.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220816202837.3257608-1-dimitrije.pavlov@arm.com> References: <20220816202837.3257608-1-dimitrije.pavlov@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Jiewen Yao Cc: Liming Gao Cc: Sunny Wang Cc: Jeff Booher-Kaeding Cc: Samer El-Haj-Mahmoud Signed-off-by: Dimitrije Pavlov Reviewed-by: Sunny Wang --- OvmfPkg/PlatformDxe/Platform.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platfor= m.c index 4bf22712c78f..a6d459f3dfd7 100644 --- a/OvmfPkg/PlatformDxe/Platform.c +++ b/OvmfPkg/PlatformDxe/Platform.c @@ -232,6 +232,10 @@ ExtractConfig ( =20 DEBUG ((DEBUG_VERBOSE, "%a: Request=3D\"%s\"\n", __FUNCTION__, Request= )); =20 + if ((Progress =3D=3D NULL) || (Results =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + Status =3D PlatformConfigToFormState (&MainFormState); if (EFI_ERROR (Status)) { *Progress =3D Request; @@ -340,6 +344,10 @@ RouteConfig ( Configuration )); =20 + if (Progress =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + // // the "read" step in RMW // --=20 2.37.2