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.web11.3141.1660575595474220741 for ; Mon, 15 Aug 2022 07:59:55 -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 CAAD0106F; Mon, 15 Aug 2022 07:59:55 -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 DFADB3F66F; Mon, 15 Aug 2022 07:59:54 -0700 (PDT) From: "Dimitrije Pavlov" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Sunny Wang , Jeff Booher-Kaeding , Samer El-Haj-Mahmoud Subject: [PATCH v1 1/1] OvmfPkg/VirtioFsDxe: Check GetDriverName arguments Date: Mon, 15 Aug 2022 09:59:43 -0500 Message-Id: <20220815145943.2874065-1-dimitrije.pavlov@arm.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit The current implementation does not check if Language or DriverName are 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: Sunny Wang Cc: Jeff Booher-Kaeding Cc: Samer El-Haj-Mahmoud Signed-off-by: Dimitrije Pavlov --- OvmfPkg/VirtioFsDxe/DriverBinding.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OvmfPkg/VirtioFsDxe/DriverBinding.c b/OvmfPkg/VirtioFsDxe/DriverBinding.c index 86eb9cf0ba51..3d80ff0f91f5 100644 --- a/OvmfPkg/VirtioFsDxe/DriverBinding.c +++ b/OvmfPkg/VirtioFsDxe/DriverBinding.c @@ -218,6 +218,10 @@ VirtioFsGetDriverName ( OUT CHAR16 **DriverName ) { + if (Language == NULL || DriverName == NULL) { + return EFI_INVALID_PARAMETER; + } + if (AsciiStrCmp (Language, "en") != 0) { return EFI_UNSUPPORTED; } -- 2.37.1