forked from premiere/premiere-libtorrent
fix infinite loop when parsing certain invalid magnet links
This commit is contained in:
parent
a9524550d7
commit
f19cca1374
|
@ -1,6 +1,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)
|
||||
|
|
|
@ -194,8 +194,7 @@ namespace libtorrent
|
|||
{
|
||||
error_code e;
|
||||
url = unescape_string(url, e);
|
||||
if (e) continue;
|
||||
p.trackers.push_back(url);
|
||||
if (!e) p.trackers.push_back(url);
|
||||
pos = uri.find("&tr=", pos);
|
||||
if (pos == std::string::npos) break;
|
||||
pos += 4;
|
||||
|
@ -209,8 +208,7 @@ namespace libtorrent
|
|||
{
|
||||
error_code e;
|
||||
url = unescape_string(url, e);
|
||||
if (e) continue;
|
||||
p.url_seeds.push_back(url);
|
||||
if (!e) p.url_seeds.push_back(url);
|
||||
pos = uri.find("&ws=", pos);
|
||||
if (pos == std::string::npos) break;
|
||||
pos += 4;
|
||||
|
|
|
@ -410,3 +410,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue