back-port resume data validation fixes

This commit is contained in:
Arvid Norberg 2018-07-08 11:27:18 +02:00 committed by Arvid Norberg
parent b5cd959dd1
commit b60912569f
1 changed files with 1 additions and 1 deletions

View File

@ -7224,7 +7224,7 @@ namespace {
if (m_torrent_file->is_merkle_torrent()) if (m_torrent_file->is_merkle_torrent())
{ {
bdecode_node mt = rd.dict_find_string("merkle tree"); bdecode_node mt = rd.dict_find_string("merkle tree");
if (mt) if (mt && mt.string_length() >= 20)
{ {
std::vector<sha1_hash> tree; std::vector<sha1_hash> tree;
tree.resize(m_torrent_file->merkle_tree().size()); tree.resize(m_torrent_file->merkle_tree().size());