]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/VirtioFsDxe: Check GetDriverName arguments
authorDimitrije Pavlov <dimitrije.pavlov@arm.com>
Mon, 15 Aug 2022 16:31:19 +0000 (11:31 -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 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.

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

index 86eb9cf0ba51b72c72838fc7400a3d9cbb337720..69d2bb77708954ef7e10f930af2d1215c267e4ef 100644 (file)
@@ -218,6 +218,10 @@ VirtioFsGetDriverName (
   OUT CHAR16                        **DriverName\r
   )\r
 {\r
+  if ((Language == NULL) || (DriverName == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   if (AsciiStrCmp (Language, "en") != 0) {\r
     return EFI_UNSUPPORTED;\r
   }\r