merged RC_1_1 into master

This commit is contained in:
arvidn 2017-10-11 11:19:02 +02:00
commit 85b6d98454
3 changed files with 27 additions and 5 deletions

View File

@ -79,6 +79,7 @@
1.1.5 release
* fix infinite loop when parsing certain invalid magnet links
* fix parsing of torrents with certain invalid filenames
* fix leak of torrent_peer objecs (entries in peer_list)
* fix leak of peer_class objects (when setting per-torrent rate limits)

View File

@ -191,9 +191,11 @@ namespace libtorrent {
error_code e;
std::string tracker = unescape_string(url, e);
if (e) continue;
p.trackers.push_back(std::move(tracker));
p.tracker_tiers.push_back(tier++);
if (!e)
{
p.trackers.push_back(std::move(tracker));
p.tracker_tiers.push_back(tier++);
}
pos = find(uri, "&tr=", pos);
if (pos == std::string::npos) break;
pos += 4;
@ -207,8 +209,7 @@ namespace libtorrent {
{
error_code e;
std::string webseed = unescape_string(url, e);
if (e) continue;
p.url_seeds.push_back(std::move(webseed));
if (!e) p.url_seeds.push_back(std::move(webseed));
pos = find(uri, "&ws=", pos);
if (pos == std::string::npos) break;
pos += 4;

View File

@ -463,3 +463,23 @@ TORRENT_TEST(trailing_whitespace)
TEST_CHECK(h.is_valid());
}
TORRENT_TEST(invalid_tracker_escaping)
{
add_torrent_params p;
p.save_path = ".";
error_code ec;
parse_magnet_uri("magnet:?tr=udp%3A%2F%2Ftracker.openjnt.com%\xf7"
"A80&tr=udp%3A%2F%2Ftracker.pub.ciltbcom%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&xt=urn:btih:a38d02c287893842a39737aa866e00828aA80&xt=urn:buntu+11.04+%28Final%29"
, p, ec);
TEST_CHECK(ec);
}
TORRENT_TEST(invalid_web_seed_escaping)
{
add_torrent_params p;
p.save_path = ".";
error_code ec;
parse_magnet_uri("magnet:?ws=udp%3A%2F%2Ftracker.openjnt.com%\xf7" "A80", p, ec);
TEST_CHECK(ec);
}