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 <Dimitrije.Pavlov@arm.com>
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
This commit is contained in:
Dimitrije Pavlov 2022-08-15 11:31:19 -05:00 committed by mergify[bot]
parent b94836b224
commit 3f282f4510
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}