mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
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 <richard.henderson@linaro.org> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Bibo Mao <maobibo@loongson.cn>
This commit is contained in:
parent
3f8bcbba3b
commit
e3526d0fd7
3 changed files with 4 additions and 4 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue