Przeglądaj źródła

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 <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/15946
Signed-off-by: Hauke Mehrtens <[email protected]>
Philip Prindeville 1 rok temu
rodzic
commit
0037100e12
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      package/base-files/files/bin/ipcalc.sh

+ 1 - 0
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))