qemu/hw/m68k
Laurent Vivier 0969e00b39 q800: fix segfault with invalid MacROM
"qemu-system-m68k -M q800 -bios /dev/null" crashes with a segfault
in q800_init().
This happens because the code doesn't check that rom_ptr() returned
a non-NULL pointer .

To avoid NULL pointer, don't allow 0 sized file and use bios_size with
rom_ptr().

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/756
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20220107105049.961489-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2022-01-09 12:03:21 +01:00
..
an5206.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
bootinfo.h m68k: import bootinfo headers from linux 2021-02-11 21:56:42 +01:00
Kconfig m68k: add Virtual M68k Machine 2021-03-15 21:03:06 +01:00
mcf5206.c m68k: do not use ram_size global 2020-12-10 12:15:08 -05:00
mcf5208.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
mcf_intc.c hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
meson.build m68k: add Virtual M68k Machine 2021-03-15 21:03:06 +01:00
next-cube.c softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate() 2021-06-15 20:27:38 +02:00
next-kbd.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
q800.c q800: fix segfault with invalid MacROM 2022-01-09 12:03:21 +01:00
virt.c hw: m68k: Add virt compat machine type for 7.0 2022-01-09 12:02:53 +01:00