Skip to content

Commit 9837e1b

Browse files
committed
fix: param list length is in cmd bytes 7-8
1 parent 44e8369 commit 9837e1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/machine/usb/msc/scsi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (m *msc) scsiCmdUnmap(cmd scsi.Cmd) {
235235
// The parameter list has an 8 byte header and 16 bytes per item. If it's less than 24 bytes it's
236236
// not the format we're expecting and we won't be able to decode it. Same for if there isn't a
237237
// 8 byte header plus multiples of 16 bytes after that
238-
paramLen := binary.BigEndian.Uint16(m.cbw.Data[7:9])
238+
paramLen := binary.BigEndian.Uint16(cmd.Data[7:9])
239239
if paramLen < 24 || (paramLen-8)%16 != 0 {
240240
m.sendScsiError(csw.StatusFailed, scsi.SenseIllegalRequest, scsi.SenseCodeInvalidFieldInCDB)
241241
return

0 commit comments

Comments
 (0)