mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-14 21:26:17 +00:00
Check the info-hash target in p.call_target
Without it an unknown info-hash segfaults the process.
This commit is contained in:
@@ -431,6 +431,9 @@ p_call_target(const torrent::Object::list_type& args) {
|
|||||||
const std::string& peer_id = itr++->as_string();
|
const std::string& peer_id = itr++->as_string();
|
||||||
const std::string& command_key = itr++->as_string();
|
const std::string& command_key = itr++->as_string();
|
||||||
|
|
||||||
|
if (download == nullptr)
|
||||||
|
throw torrent::input_error("invalid parameters: info-hash not found");
|
||||||
|
|
||||||
torrent::HashString hash;
|
torrent::HashString hash;
|
||||||
|
|
||||||
if (peer_id.size() != 40)
|
if (peer_id.size() != 40)
|
||||||
|
|||||||
Reference in New Issue
Block a user