From 00bcdaee237381d971368725ef8ee911d5839ad1 Mon Sep 17 00:00:00 2001 From: noctuum <25441068+noctuum@users.noreply.github.com> Date: Wed, 16 Sep 2026 10:34:55 +0500 Subject: [PATCH] Check the info-hash target in p.call_target Without it an unknown info-hash segfaults the process. --- src/command_download.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/command_download.cc b/src/command_download.cc index a910c178..98057744 100644 --- a/src/command_download.cc +++ b/src/command_download.cc @@ -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)