From def1459b66f283a29ae484ea436de40581ffac5c Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Tue, 30 May 2017 10:42:57 +0200 Subject: [PATCH] route: Validate input when removing static routes Signed-off-by: Jonatan Schlag --- src/functions/functions.route | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/functions/functions.route b/src/functions/functions.route index 079ad0b..c82f86e 100644 --- a/src/functions/functions.route +++ b/src/functions/functions.route @@ -151,7 +151,12 @@ route_add() { route_remove() { local _network=${1} - assert isset _network + + # Validate input + if ! ip_is_network ${_network} && ! ip_is_valid ${_network}; then + error "Invalid IP address or network: ${_network}" + return ${EXIT_ERROR} + fi local found="false" -- 2.39.2