From: Frediano Ziglio Date: Tue, 3 Sep 2024 15:15:47 +0000 (+0100) Subject: loader/efi/linux: Reset freed pointer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c34d56c2dafcd2737db0e3e49df63bce4d8b504;p=thirdparty%2Fgrub.git loader/efi/linux: Reset freed pointer Avoid dangling pointer. Code should not be reached but better safe than sorry. Signed-off-by: Frediano Ziglio Reviewed-by: Daniel Kiper --- diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c index 64ff984f5..78ea07ca8 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -241,6 +241,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args) grub_error (GRUB_ERR_BAD_OS, "start_image() returned 0x%" PRIxGRUB_EFI_UINTN_T, status); grub_efi_free_pages ((grub_addr_t) loaded_image->load_options, GRUB_EFI_BYTES_TO_PAGES (len)); + loaded_image->load_options = NULL; unload: b->unload_image (image_handle);