mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-10 02:18:41 +00:00
lt fix - fix to bound check piece index before use in incoming_allowed_fast
This commit is contained in:
parent
9251a82259
commit
93d0ab797b
1 changed files with 6 additions and 6 deletions
|
@ -1614,12 +1614,6 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if we already have the piece, we can
|
|
||||||
// ignore this message
|
|
||||||
if (t->valid_metadata()
|
|
||||||
&& t->have_piece(index))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (index < 0 || index >= int(m_have_piece.size()))
|
if (index < 0 || index >= int(m_have_piece.size()))
|
||||||
{
|
{
|
||||||
#ifdef TORRENT_VERBOSE_LOGGING
|
#ifdef TORRENT_VERBOSE_LOGGING
|
||||||
|
@ -1629,6 +1623,12 @@ namespace libtorrent
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we already have the piece, we can
|
||||||
|
// ignore this message
|
||||||
|
if (t->valid_metadata()
|
||||||
|
&& t->have_piece(index))
|
||||||
|
return;
|
||||||
|
|
||||||
m_allowed_fast.push_back(index);
|
m_allowed_fast.push_back(index);
|
||||||
|
|
||||||
// if the peer has the piece and we want
|
// if the peer has the piece and we want
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue