OvmfPkg/VirtioGpuDxe: Check QueryMode arguments

The current implementation does not check if Info or SizeInfo
pointers 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-16 15:28:36 -05:00 committed by mergify[bot]
parent 30d62f5e31
commit b94836b224
1 changed files with 4 additions and 1 deletions

View File

@ -308,7 +308,10 @@ GopQueryMode (
{
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GopModeInfo;
if (ModeNumber >= This->Mode->MaxMode) {
if ((Info == NULL) ||
(SizeOfInfo == NULL) ||
(ModeNumber >= This->Mode->MaxMode))
{
return EFI_INVALID_PARAMETER;
}