From 7f09d148b4ec2b6bca500a7bb33f97072930bc9e Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 12 Sep 2024 11:30:02 +0200 Subject: server: validate IP address Add IP validation after input parsing. --- cli/objects/server.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli') diff --git a/cli/objects/server.py b/cli/objects/server.py index a2f299d..c3f83a8 100644 --- a/cli/objects/server.py +++ b/cli/objects/server.py @@ -24,6 +24,11 @@ class OgServer(): required=True, help='valid ogserver ip address') parsed_args = parser.parse_args(args) + + if not check_address(parsed_args.address): + print(f'Invalid IP address: {parsed_args.address}') + return + payload = {'address': parsed_args.address} rest.post('/server', payload=payload) -- cgit v1.2.3-18-g5258