From 378c7ee854eb13f2e375b7be6b00454a946e1c48 Mon Sep 17 00:00:00 2001 From: noctuum <25441068+noctuum@users.noreply.github.com> Date: Fri, 18 Sep 2026 09:41:41 +0500 Subject: [PATCH] Reject a throttle rate that does not parse A discarded parse result left the rate at zero, which is unlimited. --- src/command_throttle.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/command_throttle.cc b/src/command_throttle.cc index 18267634..b2c828ae 100644 --- a/src/command_throttle.cc +++ b/src/command_throttle.cc @@ -83,7 +83,9 @@ apply_throttle(const torrent::Object::list_type& args, bool up) { throw torrent::input_error("Missing throttle rate for '" + name + "'."); int64_t rate; - rpc::parse_whole_value_nothrow(arg_itr->as_string().c_str(), &rate); + + if (!rpc::parse_whole_value_nothrow(arg_itr->as_string().c_str(), &rate)) + throw torrent::input_error("Invalid throttle rate for '" + name + "'."); if (rate < 0) throw torrent::input_error("Throttle rate must be non-negative.");