From: Frediano Ziglio via Grub-devel <grub-devel@gnu.org>
To: grub-devel@gnu.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>
Subject: [PATCH v3 4/6] loader/efi/linux: Use proper type for "len" variable
Date: Wed, 25 Jun 2025 07:42:25 +0100 [thread overview]
Message-ID: <20250625064229.17960-4-frediano.ziglio@cloud.com> (raw)
In-Reply-To: <20250625064229.17960-1-frediano.ziglio@cloud.com>
Although the length should not exceed 2^31 grub_size_t is more
suitable for that variable. "len" is used to compute the size
of buffers which in C is a size_t, not a int. It is used
for GRUB_EFI_BYTES_TO_PAGES which expects unsigned values.
It is assigned to load_options_size which is unsigned, not signed.
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
grub-core/loader/efi/linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index 5befce4d7..3b5c4ed17 100644
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -190,7 +190,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
grub_efi_boot_services_t *b;
grub_efi_status_t status;
grub_efi_loaded_image_t *loaded_image;
- int len;
+ grub_size_t len;
mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t));
if (!mempath)
--
2.49.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2025-06-25 6:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 6:42 [PATCH v3 1/6] loader/efi/linux: Remove useless assignment Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` [PATCH v3 2/6] include/grub/charset.h: Update documentation Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` [PATCH v3 3/6] loader/efi/linux: Do not pass excessive size for source string Frediano Ziglio via Grub-devel
2025-06-25 12:27 ` Daniel Kiper
2025-06-25 13:03 ` Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` Frediano Ziglio via Grub-devel [this message]
2025-06-25 6:42 ` [PATCH v3 5/6] loader/efi/linux: Use sizeof instead of constant Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` [PATCH v3 6/6] loader/efi/linux: Correctly terminate LoadOptions field Frediano Ziglio via Grub-devel
2025-06-25 12:41 ` Daniel Kiper
2025-06-25 13:27 ` Frediano Ziglio via Grub-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250625064229.17960-4-frediano.ziglio@cloud.com \
--to=grub-devel@gnu.org \
--cc=frediano.ziglio@cloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.