summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitrije Pavlov <dimitrije.pavlov@arm.com>2022-08-16 15:28:36 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-08-16 20:52:19 +0000
commitb94836b2241c16c74d70d7bb2ae478f7750655bc (patch)
tree0868d0a300a093c1aa4d6bdd93b35ad3be424e14
parent30d62f5e3170c01f3331677894f80415eec92f23 (diff)
downloadedk2-b94836b2241c16c74d70d7bb2ae478f7750655bc.tar.gz
edk2-b94836b2241c16c74d70d7bb2ae478f7750655bc.tar.bz2
edk2-b94836b2241c16c74d70d7bb2ae478f7750655bc.zip
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>
-rw-r--r--OvmfPkg/VirtioGpuDxe/Gop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/OvmfPkg/VirtioGpuDxe/Gop.c b/OvmfPkg/VirtioGpuDxe/Gop.c
index 401db47672..16e92830d4 100644
--- a/OvmfPkg/VirtioGpuDxe/Gop.c
+++ b/OvmfPkg/VirtioGpuDxe/Gop.c
@@ -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;
}