From dcb9504ec0b8615bf20d7b4478e6f4fe3ab94610 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Thu, 30 May 2013 19:29:53 -0700 Subject: [PATCH] READ6, make the truncation from a potantial 9-bit value (0-256) to 8 bits explicit by masking it with 0xff instead of relying on obscure truncation rules. --- lib/scsi-lowlevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 483dc89..ad94eef 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -1422,7 +1422,7 @@ scsi_cdb_read6(uint32_t lba, uint32_t xferlen, int blocksize) task->cdb[3] = (lba )&0xff; if (num_blocks < 256) { - task->cdb[4] = num_blocks; + task->cdb[4] = num_blocks & 0xff; } if (xferlen != 0) {