diff --git a/src/command_throttle.cc b/src/command_throttle.cc index b2c828ae..496fb48c 100644 --- a/src/command_throttle.cc +++ b/src/command_throttle.cc @@ -1,6 +1,7 @@ #include "config.h" #include +#include #include #include #include @@ -90,6 +91,9 @@ apply_throttle(const torrent::Object::list_type& args, bool up) { if (rate < 0) throw torrent::input_error("Throttle rate must be non-negative."); + if (rate > (std::numeric_limits::max() >> 10)) + throw torrent::input_error("Throttle rate is too large."); + auto itr = control->core()->throttles().find(name); if (itr == control->core()->throttles().end())