mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-04 21:29:21 +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& command_key = itr++->as_string();
|
||||
|
||||
if (download == nullptr)
|
||||
throw torrent::input_error("invalid parameters: info-hash not found");
|
||||
|
||||
torrent::HashString hash;
|
||||
|
||||
if (peer_id.size() != 40)
|
||||
|
||||
Reference in New Issue
Block a user