mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 13:45:03 -05:00
fix wrong LBA range check with sectorsizes larger than 512 bytes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16362 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7001936c99
commit
e744dd4353
1 changed files with 2 additions and 2 deletions
|
|
@ -635,7 +635,7 @@ static void handle_scsi(struct command_block_wrapper* cbw)
|
|||
|
||||
logf("scsi read %d %d", current_cmd.sector, current_cmd.count);
|
||||
|
||||
if((current_cmd.sector + current_cmd.count) * block_size_mult > block_count) {
|
||||
if((current_cmd.sector + current_cmd.count) > block_count) {
|
||||
send_csw(SCSI_STATUS_CHECK_CONDITION);
|
||||
cur_sense_data.sense_key=SENSE_ILLEGAL_REQUEST;
|
||||
cur_sense_data.asc=ASC_LBA_OUT_OF_RANGE;
|
||||
|
|
@ -670,7 +670,7 @@ static void handle_scsi(struct command_block_wrapper* cbw)
|
|||
(cbw->command_block[7] << 16 |
|
||||
cbw->command_block[8]);
|
||||
/* expect data */
|
||||
if((current_cmd.sector + current_cmd.count) * block_size_mult > block_count) {
|
||||
if((current_cmd.sector + current_cmd.count) > block_count) {
|
||||
send_csw(SCSI_STATUS_CHECK_CONDITION);
|
||||
cur_sense_data.sense_key=SENSE_ILLEGAL_REQUEST;
|
||||
cur_sense_data.asc=ASC_LBA_OUT_OF_RANGE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue