fix the torrent_info size overflow check
This commit is contained in:
parent
21fef88928
commit
2ea5115bcc
|
@ -1016,9 +1016,8 @@ namespace {
|
|||
// we want this division to round upwards, that's why we have the
|
||||
// extra addition
|
||||
|
||||
if (files.total_size() >=
|
||||
(std::numeric_limits<std::int64_t>::max() / files.piece_length())
|
||||
- files.piece_length())
|
||||
if (files.total_size() >= static_cast<std::int64_t>(std::numeric_limits<int>::max() - files.piece_length())
|
||||
* files.piece_length())
|
||||
{
|
||||
ec = errors::too_many_pieces_in_torrent;
|
||||
// mark the torrent as invalid
|
||||
|
|
Loading…
Reference in New Issue