From bb89a07a63f41f5ad955524fe73c71c1378dea8f Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 5 Jan 2017 04:46:50 +0100 Subject: [PATCH] Sanitized the buffer zeroing on REQUEST SENSE for both ATAPI and SCSI. --- src/ide.c | 5 ++++- src/scsi_cdrom.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ide.c b/src/ide.c index ac3d583cd..cd3300612 100644 --- a/src/ide.c +++ b/src/ide.c @@ -1946,7 +1946,10 @@ static void atapicommand(int ide_board) temp_command = idebufferb[0]; /*Will return 18 bytes of 0*/ - memset(idebufferb,0,512); + if (alloc_length != 0) + { + memset(idebufferb, 0, alloc_length); + } idebufferb[0]=0x80|0x70; diff --git a/src/scsi_cdrom.c b/src/scsi_cdrom.c index 099ca1c23..1528fea91 100644 --- a/src/scsi_cdrom.c +++ b/src/scsi_cdrom.c @@ -636,7 +636,7 @@ int cdrom_read_data(uint8_t *buffer) } } - // pclog("CD-ROM sector size: %i (%i, %i) [%04X]\n", cdrom_sector_size, cdrom_sector_type, real_sector_type, cdrom_sector_flags); + pclog("CD-ROM sector size: %i (%i, %i) [%04X]\n", cdrom_sector_size, cdrom_sector_type, real_sector_type, cdrom_sector_flags); return cdrom_add_error_and_subchannel(b, real_sector_type); }