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)
|
||||
* added support for hashing pieces in multiple threads
|
||||
|
||||
* fix bound-checking issue in bdecoder
|
||||
* expose missing dht_settings fields to python
|
||||
* add function to query the DHT settings
|
||||
* fix bug in 'dont_count_slow_torrents' feature, which would start too many
|
||||
|
|
|
@ -130,7 +130,9 @@ namespace libtorrent
|
|||
if (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);
|
||||
|
||||
if (len < 0)
|
||||
|
@ -196,15 +198,19 @@ namespace libtorrent
|
|||
start = parse_int(start, end, ':', len, e);
|
||||
if (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);
|
||||
if (len < 0)
|
||||
TORRENT_FAIL_BDECODE(bdecode_errors::overflow);
|
||||
|
||||
++start;
|
||||
if (start == end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);
|
||||
top->construct_string(start, int(len));
|
||||
stack.pop_back();
|
||||
start += len;
|
||||
stack.pop_back();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue