Fixed potential SCSI ID overruns in the SCSI hard diks, CD-ROM, and Iomega ZIP codes.

This commit is contained in:
OBattler
2020-01-15 00:49:42 +01:00
parent 34bf074e8d
commit 2b94cd2b96
3 changed files with 3 additions and 3 deletions

View File

@@ -2368,7 +2368,7 @@ zip_hard_reset(void)
zip_log("ZIP hard_reset drive=%d\n", c);
/* Make sure to ignore any SCSI ZIP drive that has an out of range ID. */
if ((zip_drives[c].bus_type == ZIP_BUS_SCSI) && (zip_drives[c].scsi_device_id > SCSI_ID_MAX))
if ((zip_drives[c].bus_type == ZIP_BUS_SCSI) && (zip_drives[c].scsi_device_id >= SCSI_ID_MAX))
continue;
/* Make sure to ignore any ATAPI ZIP drive that has an out of range IDE channel. */

View File

@@ -2545,7 +2545,7 @@ scsi_cdrom_drive_reset(int c)
ide_t *id;
/* Make sure to ignore any SCSI CD-ROM drive that has an out of range ID. */
if ((drv->bus_type == CDROM_BUS_SCSI) && (drv->scsi_device_id > SCSI_ID_MAX))
if ((drv->bus_type == CDROM_BUS_SCSI) && (drv->scsi_device_id >= SCSI_ID_MAX))
return;
/* Make sure to ignore any ATAPI CD-ROM drive that has an out of range IDE channel. */

View File

@@ -1212,7 +1212,7 @@ scsi_disk_hard_reset(void)
scsi_disk_log("SCSI disk hard_reset drive=%d\n", c);
/* Make sure to ignore any SCSI disk that has an out of range ID. */
if (hdd[c].scsi_id > SCSI_ID_MAX)
if (hdd[c].scsi_id >= SCSI_ID_MAX)
continue;
/* Make sure to ignore any SCSI disk whose image file name is empty. */