From: Jonatan Schlag Date: Tue, 30 May 2017 09:26:50 +0000 (+0200) Subject: ip_is_network: Fix assertion crash when address part was invalid X-Git-Tag: 009~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d58a3bffb53fda1cf1a966b549db86abf74b3f8;p=network.git ip_is_network: Fix assertion crash when address part was invalid Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.ip b/src/functions/functions.ip index 69d0c512..f8ffff70 100644 --- a/src/functions/functions.ip +++ b/src/functions/functions.ip @@ -91,9 +91,10 @@ ip_is_network() { local prefix=$(ip_get_prefix ${network}) isset prefix || return ${EXIT_FALSE} - # Detect the protocol. + # Detect the protocol (if this fails, the + # address part is invalid) local proto=$(ip_detect_protocol ${address}) - assert isset proto + isset proto || return ${EXIT_FALSE} # Check if the prefix is correct. ip_prefix_is_valid ${proto} ${prefix} || return ${EXIT_FALSE}