forked from premiere/premiere-libtorrent
merged fix from RC_1_0
This commit is contained in:
parent
5d6cba438d
commit
d9945f6f50
|
@ -70,6 +70,7 @@
|
||||||
* almost completely changed the storage interface (for custom storage)
|
* almost completely changed the storage interface (for custom storage)
|
||||||
* added support for hashing pieces in multiple threads
|
* added support for hashing pieces in multiple threads
|
||||||
|
|
||||||
|
* fix bound-checking issue in bdecoder
|
||||||
* expose missing dht_settings fields to python
|
* expose missing dht_settings fields to python
|
||||||
* add function to query the DHT settings
|
* add function to query the DHT settings
|
||||||
* fix bug in 'dont_count_slow_torrents' feature, which would start too many
|
* fix bug in 'dont_count_slow_torrents' feature, which would start too many
|
||||||
|
|
|
@ -130,7 +130,9 @@ namespace libtorrent
|
||||||
if (e)
|
if (e)
|
||||||
TORRENT_FAIL_BDECODE(e);
|
TORRENT_FAIL_BDECODE(e);
|
||||||
|
|
||||||
if (start + len + 1 > end)
|
// remaining buffer size excluding ':'
|
||||||
|
const ptrdiff_t buff_size = end - start - 1;
|
||||||
|
if (len > buff_size)
|
||||||
TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);
|
TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);
|
||||||
|
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
|
@ -196,15 +198,19 @@ namespace libtorrent
|
||||||
start = parse_int(start, end, ':', len, e);
|
start = parse_int(start, end, ':', len, e);
|
||||||
if (e)
|
if (e)
|
||||||
TORRENT_FAIL_BDECODE(e);
|
TORRENT_FAIL_BDECODE(e);
|
||||||
if (start + len + 1 > end)
|
|
||||||
|
// remaining buffer size excluding ':'
|
||||||
|
const ptrdiff_t buff_size = end - start - 1;
|
||||||
|
if (len > buff_size)
|
||||||
TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);
|
TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
TORRENT_FAIL_BDECODE(bdecode_errors::overflow);
|
TORRENT_FAIL_BDECODE(bdecode_errors::overflow);
|
||||||
|
|
||||||
++start;
|
++start;
|
||||||
|
if (start == end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);
|
||||||
top->construct_string(start, int(len));
|
top->construct_string(start, int(len));
|
||||||
stack.pop_back();
|
|
||||||
start += len;
|
start += len;
|
||||||
|
stack.pop_back();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue