summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/VirtioFsDxe
diff options
context:
space:
mode:
authorDimitrije Pavlov <dimitrije.pavlov@arm.com>2022-08-15 11:31:19 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-08-16 20:52:19 +0000
commit3f282f451023234e16510516fbad20cd0ca04847 (patch)
tree4477f132d72f0d8fa0dc595bad409bc29f529a2b /OvmfPkg/VirtioFsDxe
parentb94836b2241c16c74d70d7bb2ae478f7750655bc (diff)
downloadedk2-3f282f451023234e16510516fbad20cd0ca04847.tar.gz
edk2-3f282f451023234e16510516fbad20cd0ca04847.tar.bz2
edk2-3f282f451023234e16510516fbad20cd0ca04847.zip
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>
Diffstat (limited to 'OvmfPkg/VirtioFsDxe')
-rw-r--r--OvmfPkg/VirtioFsDxe/DriverBinding.c4
1 files changed, 4 insertions, 0 deletions
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;
}