[spice-gtk,v2,19/33] fixup! usb-redir: add files for SCSI and USB MSC implementation

Submitted by Frediano Ziglio on Aug. 9, 2019, 2:26 p.m.

Details

Message ID 20190809142651.2967-20-fziglio@redhat.com
State Superseded
Headers show
Series "CD emulation follow ups" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Aug. 9, 2019, 2:26 p.m.
Remove potential integer overflow.
count can be specified with all bits.
---
 src/cd-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/cd-scsi.c b/src/cd-scsi.c
index 1cb268bf..d039e3c4 100644
--- a/src/cd-scsi.c
+++ b/src/cd-scsi.c
@@ -2545,7 +2545,7 @@  static void cd_scsi_cmd_read(CdScsiLU *dev, CdScsiRequest *req)
     req->offset = req->lba * dev->block_size;
 
     req->count = scsi_cdb_xfer_length(req->cdb, req->cdb_len); /* xfer in blocks */
-    req->req_len = req->count * dev->block_size;
+    req->req_len = (uint64_t) req->count * dev->block_size;
 
     cd_scsi_read_async_start(dev, req);
 }