Message ID | 20241108230314.1980-1-slp@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | hw/i386/elfboot: allocate "header" in heap | expand |
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index bc360a9ea4..d51ebad4d6 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -697,9 +697,12 @@ void x86_load_linux(X86MachineState *x86ms, strlen(kernel_cmdline) + 1); fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline); + setup = g_malloc(sizeof(header)); + memcpy(setup, header, sizeof(header)); + fw_cfg_add_i32(fw_cfg, FW_CFG_SETUP_SIZE, sizeof(header)); fw_cfg_add_bytes(fw_cfg, FW_CFG_SETUP_DATA, - header, sizeof(header)); + setup, sizeof(header)); /* load initrd */ if (initrd_filename) {