dns.cgi: Check for empty server address.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2020-01-08 12:12:29 +01:00
parent 70187da6a6
commit 038f962ea0
2 changed files with 7 additions and 1 deletions

View File

@@ -95,8 +95,13 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L
# Read-in generic settings.
&General::readhash("$settings_file", \%settings);
# Check if an IP-address has been given.
if ($cgiparams{"NAMESERVER"} eq "") {
$errormessage = "$Lang::tr{'dns no address given'}";
}
# Check if the given DNS server is valid.
if(!&General::validip($cgiparams{"NAMESERVER"})) {
elsif(!&General::validip($cgiparams{"NAMESERVER"})) {
$errormessage = "$Lang::tr{'invalid ip'}: $cgiparams{'NAMESERVER'}";
}