merged fix from RC_0_16
This commit is contained in:
parent
01f60fa20c
commit
a220b8df0c
@ -2077,6 +2077,22 @@ namespace libtorrent
|
||||
|
||||
boost::shared_ptr<torrent> t = associated_torrent().lock();
|
||||
TORRENT_ASSERT(t);
|
||||
|
||||
// piece_block can't necessarily hold large piece numbers
|
||||
// so check that first
|
||||
if (r.piece < 0
|
||||
|| r.piece >= t->torrent_file().num_pieces()
|
||||
|| r.start < 0
|
||||
|| r.start > t->torrent_file().piece_length())
|
||||
{
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
peer_log("*** INVALID_PIECE [ piece: %d s: %d l: %d ]"
|
||||
, r.piece, r.start, r.length);
|
||||
#endif
|
||||
disconnect(errors::invalid_piece, 2);
|
||||
return;
|
||||
}
|
||||
|
||||
piece_block b(r.piece, r.start / t->block_size());
|
||||
m_receiving_block = b;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user