From: Jonatan Schlag Date: Tue, 30 May 2017 08:42:57 +0000 (+0200) Subject: route: Validate input when removing static routes X-Git-Tag: 009~250^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=def1459b66f283a29ae484ea436de40581ffac5c;p=network.git route: Validate input when removing static routes Signed-off-by: Jonatan Schlag --- diff --git a/src/functions/functions.route b/src/functions/functions.route index 079ad0b6..c82f86eb 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"