Made sure that only existent CDB bytes get accessed by SCSI command logging. Coverity CID 21806.

This commit is contained in:
Thomas Schmitt 2015-10-23 10:35:42 +00:00
parent d06138d6b2
commit 1a6fd3ad95
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2015.10.19.174459"
#define Cdrskin_timestamP "2015.10.23.103324"

View File

@ -1753,12 +1753,12 @@ int scsi_show_command(unsigned char *opcode, int oplen, int dir,
if (flag & 1)
return 1;
if (opcode[0] == 0x2A) { /* WRITE 10 */
if (flag & 2)
if ((flag & 2) && oplen > 8)
fprintf(fp, "%d -> %d\n",
(opcode[7] << 8) | opcode[8],
mmc_four_char_to_int(opcode + 2));
} else if (opcode[0] == 0xAA) { /* WRITE 12 */
if (flag & 2)
if ((flag & 2) && oplen > 9)
fprintf(fp, "%d -> %d\n",
mmc_four_char_to_int(opcode + 6),
mmc_four_char_to_int(opcode + 2));