]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
kern/efi/mm: Format string error in grub_error()
authorGlenn Washburn <development@efficientek.com>
Fri, 5 Mar 2021 00:22:38 +0000 (18:22 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 10 Mar 2021 13:56:06 +0000 (14:56 +0100)
The second format string argument, GRUB_EFI_MAX_USABLE_ADDRESS, is a macro
to a number literal. However, depending on what the target architecture, the
type can be 32 or 64 bits. Cast to a 64-bit integer. Also, change the
format string literals "%llx" to use PRIxGRUB_UINT64_T.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/efi/mm.c

index 8d380c054bf9378216cd2e73ec44146be7e54b32..0cdb063bb1b6f186a24dd8801611c4c637394f48 100644 (file)
@@ -127,8 +127,9 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address,
   if (address > GRUB_EFI_MAX_USABLE_ADDRESS)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT,
-                 N_("invalid memory address (0x%llx > 0x%llx)"),
-                 address, GRUB_EFI_MAX_USABLE_ADDRESS);
+                 N_("invalid memory address (0x%" PRIxGRUB_UINT64_T
+                     " > 0x%" PRIxGRUB_UINT64_T ")"),
+                 address, (grub_efi_uint64_t) GRUB_EFI_MAX_USABLE_ADDRESS);
       return NULL;
     }