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
This commit is contained in:
uweseimet 2021-06-23 19:16:27 +02:00 committed by GitHub
parent 54cf4322aa
commit 86aeeb0a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}