diff options
author | DjLegolas <djlegolas@protonmail.com> | 2022-08-01 20:02:18 +0300 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2023-02-27 17:39:00 +0000 |
commit | 38feea0fa46913de8a070a6c19669d07df596571 (patch) | |
tree | cfce611679ed36dfdcd481ad7b61c7556b54d1a0 | |
parent | 7af584d64976daaf27bf3daf0a5f896c9a25f5eb (diff) | |
download | deluge-38feea0fa46913de8a070a6c19669d07df596571.tar.gz deluge-38feea0fa46913de8a070a6c19669d07df596571.tar.bz2 deluge-38feea0fa46913de8a070a6c19669d07df596571.zip |
[hostlist] Add port value validation
When in console, and adding a new host with an invalid port number, the
console starts printing many exceptions regarding the value.
Therefor, we will make sure that the port value is between 0 and 65535.
-rw-r--r-- | deluge/ui/hostlist.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/deluge/ui/hostlist.py b/deluge/ui/hostlist.py index 0fc3eabd8..0dba1269e 100644 --- a/deluge/ui/hostlist.py +++ b/deluge/ui/hostlist.py @@ -50,6 +50,8 @@ def validate_host_info(hostname, port): if not isinstance(port, int): raise ValueError('Invalid port. Must be an integer') + if not 0 <= port <= 65535: + raise ValueError('Invalid port. Must be between 0-65535') def migrate_hostlist(old_filename, new_filename): |