merge bdecode patch from RC_1_0. an empty string now produces an error rather than an empty bdecoded struct

This commit is contained in:
arvidn
2015-07-30 21:29:22 -04:00
parent 3dda8f97d6
commit 52b4aed466
5 changed files with 12 additions and 5 deletions

View File

@@ -96,10 +96,12 @@ namespace libtorrent
{
char const* const orig_start = start;
ret.clear();
if (start == end) return 0;
std::vector<lazy_entry*> stack;
if (start == end)
TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);
stack.push_back(&ret);
while (start <= end)
{