+2011-05-09 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/loader/efi/chainloader.c (grub_chainloader_unload): Set
+ file_path to 0 for surety.
+ (grub_chainloader_boot): Set exit_data to NULL.
+ Unset the loader once done.
+ (grub_cmd_chainloader): Fix confusing error message if file is empty.
+
2011-05-09 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/term/at_keyboard.c (fetch_key): Make a printf on
grub_free (file_path);
grub_free (cmdline);
cmdline = 0;
+ file_path = 0;
grub_dl_unref (my_mod);
return GRUB_ERR_NONE;
grub_efi_boot_services_t *b;
grub_efi_status_t status;
grub_efi_uintn_t exit_data_size;
- grub_efi_char16_t *exit_data;
+ grub_efi_char16_t *exit_data = NULL;
b = grub_efi_system_table->boot_services;
status = efi_call_3 (b->start_image, image_handle, &exit_data_size, &exit_data);
if (exit_data)
efi_call_1 (b->free_pool, exit_data);
- grub_chainloader_unload ();
+ grub_loader_unset ();
return grub_errno;
}
grub_efi_print_device_path (file_path);
size = grub_file_size (file);
+ if (!size)
+ {
+ grub_error (GRUB_ERR_BAD_OS, "file is empty");
+ goto fail;
+ }
pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12);
status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES,