Re: [PATCH v2] q800: fix segfault with invalid MacROM

2022-01-07 Thread Mark Cave-Ayland
On 07/01/2022 10:50, Laurent Vivier wrote: "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()

Re: [PATCH v2] q800: fix segfault with invalid MacROM

2022-01-07 Thread Thomas Huth
On 07/01/2022 11.50, Laurent Vivier wrote: "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().