summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformDxe
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2019-09-12 23:53:16 +0200
committerLaszlo Ersek <lersek@redhat.com>2019-10-09 09:40:10 +0200
commit35dd574a240017553b1b3dad6ec1cd94c2ab1a5e (patch)
tree4bcdbddfdd481930a041609ecc2612d99fc9c882 /OvmfPkg/PlatformDxe
parent19c2a928055897cfe24e6badb8d43516ce377092 (diff)
downloadedk2-35dd574a240017553b1b3dad6ec1cd94c2ab1a5e.tar.gz
edk2-35dd574a240017553b1b3dad6ec1cd94c2ab1a5e.tar.bz2
edk2-35dd574a240017553b1b3dad6ec1cd94c2ab1a5e.zip
OvmfPkg/PlatformDxe: fix EFI_HII_HANDLE parameters of internal functions
In the following call tree: PlatformInit () mInstalledPackages = HiiAddPackages () GopInstalled () PopulateForm (PackageList = mInstalledPackages) CreateResolutionOptions (PackageList) HiiSetString (PackageList HiiUpdateForm (PackageList) PlatformDxe passes around an EFI_HII_HANDLE that (a) originates from HiiAddPackages() and (b) is ultimately passed to HiiSetString() and HiiUpdateForm(). The intermediate functions PopulateForm() and CreateResolutionOptions() however take that parameter as an (EFI_HII_HANDLE*). There is no bug in practice (because the affected functions never try to de-reference the "PackageList" parameter, they just pass it on), but the function prototypes are semantically wrong. Fix that. This could remain hidden so long because pointer-to-VOID silently converts to/from any pointer-to-object type, and the UEFI spec mandates that EFI_HII_HANDLE be a typedef to (VOID*). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'OvmfPkg/PlatformDxe')
-rw-r--r--OvmfPkg/PlatformDxe/Platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
index 09181769ba..23ad43901f 100644
--- a/OvmfPkg/PlatformDxe/Platform.c
+++ b/OvmfPkg/PlatformDxe/Platform.c
@@ -486,7 +486,7 @@ STATIC
EFI_STATUS
EFIAPI
CreateResolutionOptions (
- IN EFI_HII_HANDLE *PackageList,
+ IN EFI_HII_HANDLE PackageList,
OUT VOID **OpCodeBuffer,
IN UINTN NumGopModes,
IN GOP_MODE *GopModes
@@ -547,7 +547,7 @@ STATIC
EFI_STATUS
EFIAPI
PopulateForm (
- IN EFI_HII_HANDLE *PackageList,
+ IN EFI_HII_HANDLE PackageList,
IN EFI_GUID *FormSetGuid,
IN EFI_FORM_ID FormId,
IN UINTN NumGopModes,