From: Avi Kivity <[email protected]>

The buffer that is used to store the extboot filename is later overwritten
by the vga rom loading code.  Use strdup() to keep our filename.

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/hw/pc.c b/hw/pc.c
index db34f53..4b17b9c 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -963,7 +963,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
 
     if (extboot_drive != -1) {
        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, EXTBOOT_FILENAME);
-        option_rom[nb_option_roms++] = buf;
+        option_rom[nb_option_roms++] = strdup(buf);
     }
 
     option_rom_offset = qemu_ram_alloc(0x20000);
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to