Check port is in valid range

This commit is contained in:
Roland Shoemaker 2015-08-11 12:30:37 -07:00
parent 4a26a515c9
commit e629c61d5d
1 changed files with 3 additions and 0 deletions

View File

@ -260,6 +260,9 @@ func (va ValidationAuthorityImpl) validateSimpleHTTP(identifier core.AcmeIdentif
return fmt.Errorf("Malformed host")
}
host, port = splitHost[0], splitHost[1]
if port < 0 || port > 65535 {
return fmt.Errorf("Invalid port number in redirect")
}
} else if strings.ToLower(req.URL.Scheme) == "https" {
port = "443"
}