From 86aeeb0a31205e4fe923de77df870022ea85f730 Mon Sep 17 00:00:00 2001 From: uweseimet <48174652+uweseimet@users.noreply.github.com> Date: Wed, 23 Jun 2021 19:16:27 +0200 Subject: [PATCH] Segmentation fault fix for missing unit 0 (#115) * Removed unused code, added some translations * Fixed segmentation fault when there is no unit 0 * Removed unrelated changes --- src/raspberrypi/controllers/scsidev_ctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raspberrypi/controllers/scsidev_ctrl.cpp b/src/raspberrypi/controllers/scsidev_ctrl.cpp index d4bd2e43..b2557fea 100644 --- a/src/raspberrypi/controllers/scsidev_ctrl.cpp +++ b/src/raspberrypi/controllers/scsidev_ctrl.cpp @@ -1517,7 +1517,7 @@ void FASTCALL SCSIDEV::Send() // The Daynaport needs to have a delay after the size/flags field // of the read response. In the MacOS driver, it looks like the // driver is doing two "READ" system calls. - if (ctrl.unit[0]->GetID() == MAKEID('S', 'C', 'D', 'P')) { + if (ctrl.unit[0] && ctrl.unit[0]->GetID() == MAKEID('S', 'C', 'D', 'P')) { len = ((GPIOBUS*)ctrl.bus)->SendHandShake( &ctrl.buffer[ctrl.offset], ctrl.length, SCSIDaynaPort::DAYNAPORT_READ_HEADER_SZ); }