summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Prindeville2024-07-14 20:07:53 +0000
committerHauke Mehrtens2024-07-21 15:31:59 +0000
commit0037100e129d3b2abedc08864c82230ab4565b21 (patch)
tree869a80da598f5aafaa34ac54a376f8104dcec884
parentf84a9f7dc095967e41ced96e1ea5f9b2b9f40af6 (diff)
downloadopenwrt-0037100e129d3b2abedc08864c82230ab4565b21.tar.gz
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 <philipp@redfish-solutions.com> Link: https://github.com/openwrt/openwrt/pull/15946 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rwxr-xr-xpackage/base-files/files/bin/ipcalc.sh1
1 files changed, 1 insertions, 0 deletions
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))