From e3526d0fd73949fd6eafd97711351a7934b496a3 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Thu, 2 Jan 2025 22:47:21 +0000 Subject: hw/core/loader: Use ssize_t for efi zboot unpacker Convert to use sszie_t to represent size internally to avoid large image overflowing the size. Suggested-by: Richard Henderson Signed-off-by: Jiaxun Yang Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao --- hw/core/loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/core/loader.c') diff --git a/hw/core/loader.c b/hw/core/loader.c index c0407e2d0d..4dfdb027ee 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -886,11 +886,11 @@ struct linux_efi_zboot_header { * * If the image is not a Linux EFI zboot image, do nothing and return success. */ -ssize_t unpack_efi_zboot_image(uint8_t **buffer, int *size) +ssize_t unpack_efi_zboot_image(uint8_t **buffer, ssize_t *size) { const struct linux_efi_zboot_header *header; uint8_t *data = NULL; - int ploff, plsize; + ssize_t ploff, plsize; ssize_t bytes; /* ignore if this is too small to be a EFI zboot image */ -- cgit 1.4.1