From 38feea0fa46913de8a070a6c19669d07df596571 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Mon, 1 Aug 2022 20:02:18 +0300 Subject: [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. --- deluge/ui/hostlist.py | 2 ++ 1 file changed, 2 insertions(+) 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): -- cgit