From 0037100e129d3b2abedc08864c82230ab4565b21 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Sun, 14 Jul 2024 14:07:53 -0600 Subject: [PATCH] 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 --- package/base-files/files/bin/ipcalc.sh | 1 + 1 file changed, 1 insertion(+) 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)) -- 2.30.2