From 3f282f451023234e16510516fbad20cd0ca04847 Mon Sep 17 00:00:00 2001 From: Dimitrije Pavlov Date: Mon, 15 Aug 2022 11:31:19 -0500 Subject: OvmfPkg/VirtioFsDxe: Check GetDriverName arguments 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 Reviewed-by: Sunny Wang --- OvmfPkg/VirtioFsDxe/DriverBinding.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OvmfPkg/VirtioFsDxe') diff --git a/OvmfPkg/VirtioFsDxe/DriverBinding.c b/OvmfPkg/VirtioFsDxe/DriverBinding.c index 86eb9cf0ba..69d2bb7770 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; } -- cgit v1.2.3