boot/shim: fix char ** vs char * mismatch
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 27 Nov 2017 12:36:21 +0000 (12:36 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Nov 2017 08:25:38 +0000 (09:25 +0100)
This code cannot have ever worked ;(

Found by coverity, obvious when the type is not obfuscated to void*.

src/boot/efi/shim.c

index 6da9ee8..d66b39b 100644 (file)
@@ -162,7 +162,7 @@ static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROT
         EFI_DEVICE_PATH *dev_path;
         EFI_HANDLE h;
         EFI_FILE *root;
-        VOID *file_buffer = NULL;
+        CHAR8 *file_buffer = NULL;
         UINTN file_size;
         CHAR16 *dev_path_str;
 
@@ -182,7 +182,7 @@ static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROT
         dev_path_str = DevicePathToStr(dev_path);
         FreePool(dev_path);
 
-        file_size = file_read(root, dev_path_str, 0, 0, file_buffer);
+        file_size = file_read(root, dev_path_str, 0, 0, &file_buffer);
         FreePool(dev_path_str);
         uefi_call_wrapper(root->Close, 1, root);