From a2f1c5f5334483644cf433268b22cfa60c5654eb Mon Sep 17 00:00:00 2001 From: Markus Fenske Date: Wed, 13 Feb 2019 16:14:12 +0100 Subject: [PATCH] Security update --- nsupdate-client | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nsupdate-client b/nsupdate-client index 0738d60..feecc8e 100755 --- a/nsupdate-client +++ b/nsupdate-client @@ -80,7 +80,11 @@ fi if [ "$DEST" = "external" ]; then echo "> Getting IP address..." - DEST=$(curl -s http://bot.whatismyipaddress.com) + DEST=$(curl -s https://bot.whatismyipaddress.com) + if ! echo "$DEST" | grep -Eq "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"; then + echo "Error: Did not receive a valid IP" + exit + fi elif [[ "$DEST" == *if_* ]]; then echo "> Getting IP address..." IFACE=$(echo "$DEST" | sed 's/if_//g')