1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

fix r6965 oops

This commit is contained in:
Charles Kerr 2008-10-27 04:39:30 +00:00
parent 631d9d9a8f
commit 5ad58ea83e

View file

@ -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,