From: Philip Prindeville Date: Sun, 14 Jul 2024 20:07:53 +0000 (-0600) Subject: base-files: ipcalc.sh handle start and range being empty strings X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0037100e129d3b2abedc08864c82230ab4565b21;p=openwrt%2Fstaging%2Fsvanheule.git base-files: ipcalc.sh handle start and range being empty strings If we're being paranoid and quote all the arguments to ipcalc.sh, it's possible to pass in empty start and range arguments. This should be handled the same as their being absent. Signed-off-by: Philip Prindeville Link: https://github.com/openwrt/openwrt/pull/15946 Signed-off-by: Hauke Mehrtens --- diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index ae7a5c9598..871a49ed6e 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -96,6 +96,7 @@ echo "COUNT=$count" # if there's no range, we're done [ $# -eq 0 ] && exit 0 +[ -z "$1$2" ] && exit 0 if [ "$prefix" -le 30 ]; then lower=$((network + 1))