fixed a bug which caused a cidr being parsed as an ip and eventually a panic (fixes #241)

This commit is contained in:
evilsocket 2018-04-26 19:33:05 +02:00
parent 735d074cd8
commit ae0afc54b5
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@ func main() {
}
defer sess.Close()
if core.HasColors == false {
if !core.HasColors {
if *sess.Options.NoColors {
fmt.Printf("\n\nWARNING: Terminal colors have been disabled, view will be very limited.\n\n")
} else {

View file

@ -133,7 +133,7 @@ func buildEndpointFromInterface(iface net.Interface) (*Endpoint, error) {
for _, a := range addrs {
address := a.String()
if IPv4Validator.MatchString(address) {
if strings.ContainsRune(address, '/') {
if !strings.ContainsRune(address, '/') {
// plain ip
e.SetIP(address)
} else {