From e25c42f2b297b81ed5582ea08be3427821782fbe Mon Sep 17 00:00:00 2001 From: Christoph Borchert Date: Fri, 9 Sep 2016 11:32:14 +0200 Subject: [PATCH] bochs: fix segmentation fault (after BX_PANIC) in HDD controller Change-Id: I584e883b89ae36f4cee83684f9461e7baafa1495 --- simulators/bochs/iodev/harddrv.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simulators/bochs/iodev/harddrv.cc b/simulators/bochs/iodev/harddrv.cc index 3c990ea5..c3452181 100644 --- a/simulators/bochs/iodev/harddrv.cc +++ b/simulators/bochs/iodev/harddrv.cc @@ -1245,8 +1245,10 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len) break; case 0xa0: // PACKET - if (BX_SELECTED_CONTROLLER(channel).buffer_index >= PACKET_SIZE) + if (BX_SELECTED_CONTROLLER(channel).buffer_index >= PACKET_SIZE) { BX_PANIC(("IO write(0x%04x): buffer_index >= PACKET_SIZE", address)); + return; + } switch (io_len) { case 4: