public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] OvmfPkg/VirtioFsDxe: Check GetDriverName arguments
@ 2022-08-15 14:59 Dimitrije Pavlov
  2022-08-15 15:16 ` [edk2-devel] " Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitrije Pavlov @ 2022-08-15 14:59 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Jiewen Yao, Sunny Wang, Jeff Booher-Kaeding,
	Samer El-Haj-Mahmoud

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 <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
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/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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-15 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-15 14:59 [PATCH v1 1/1] OvmfPkg/VirtioFsDxe: Check GetDriverName arguments Dimitrije Pavlov
2022-08-15 15:16 ` [edk2-devel] " Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox