Currently, if "linux" fails, the "goto fail;" in grub_cmd_initrd sends us into grub_initrd_close() without grub_initrd_init() being called, and thus it never clears initrd_ctx->components. grub_initrd_close() then frees that address, which is stale data from the stack. If the stack happens to have a stale *address* there that matches a recent allocation, then you'll get a double free later. So initialize the memory up front. Signed-off-by: Peter Jones <pjones@redhat.com> |
||
|---|---|---|
| .. | ||
| coreboot | ||
| pc | ||
| bsd.c | ||
| bsd32.c | ||
| bsd64.c | ||
| bsd_pagetable.c | ||
| bsdXX.c | ||
| linux.c | ||
| multiboot_mbi.c | ||
| xen.c | ||
| xen_file.c | ||
| xen_file32.c | ||
| xen_file64.c | ||
| xen_fileXX.c | ||
| xnu.c | ||