OSDN Git Service

mips_mipssim: fix use-after-free for filename
authorGonglei <arei.gonglei@huawei.com>
Sat, 15 Nov 2014 10:06:41 +0000 (18:06 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 17 Nov 2014 10:41:03 +0000 (11:41 +0100)
May pass freed pointer filename as an argument to error_report.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/mips/mips_mipssim.c

index 7ea0b9a..5d44c3f 100644 (file)
@@ -197,7 +197,7 @@ mips_mipssim_init(MachineState *machine)
         !kernel_filename && !qtest_enabled()) {
         /* Bail out if we have neither a kernel image nor boot vector code. */
         error_report("Could not load MIPS bios '%s', and no "
-                     "-kernel argument was specified", filename);
+                     "-kernel argument was specified", bios_name);
         exit(1);
     } else {
         /* We have a boot vector start address. */