mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
fix r6965 oops
This commit is contained in:
parent
631d9d9a8f
commit
5ad58ea83e
1 changed files with 5 additions and 3 deletions
|
@ -1555,12 +1555,14 @@ tr_torrentReqIsValid( const tr_torrent * tor,
|
||||||
|
|
||||||
if( index >= tor->info.pieceCount )
|
if( index >= tor->info.pieceCount )
|
||||||
err = 1;
|
err = 1;
|
||||||
else if( ( offset + length ) >= tr_torPieceCountBytes( tor, index ) )
|
if( length < 1 )
|
||||||
err = 2;
|
err = 2;
|
||||||
else if( length > MAX_BLOCK_SIZE )
|
else if( ( offset + length ) > tr_torPieceCountBytes( tor, index ) )
|
||||||
err = 3;
|
err = 3;
|
||||||
else if( tr_pieceOffset( tor, index, offset, length ) > tor->info.totalSize )
|
else if( length > MAX_BLOCK_SIZE )
|
||||||
err = 4;
|
err = 4;
|
||||||
|
else if( tr_pieceOffset( tor, index, offset, length ) > tor->info.totalSize )
|
||||||
|
err = 5;
|
||||||
|
|
||||||
if( err ) fprintf( stderr, "index %lu offset %lu length %lu err %d\n",
|
if( err ) fprintf( stderr, "index %lu offset %lu length %lu err %d\n",
|
||||||
(unsigned long)index, (unsigned long)offset,
|
(unsigned long)index, (unsigned long)offset,
|
||||||
|
|
Loading…
Reference in a new issue