mirror of
https://github.com/bettercap/bettercap
synced 2025-07-10 23:33:28 -07:00
fixed a bug which caused a cidr being parsed as an ip and eventually a panic (fixes #241)
This commit is contained in:
parent
735d074cd8
commit
ae0afc54b5
2 changed files with 2 additions and 2 deletions
2
main.go
2
main.go
|
@ -19,7 +19,7 @@ func main() {
|
||||||
}
|
}
|
||||||
defer sess.Close()
|
defer sess.Close()
|
||||||
|
|
||||||
if core.HasColors == false {
|
if !core.HasColors {
|
||||||
if *sess.Options.NoColors {
|
if *sess.Options.NoColors {
|
||||||
fmt.Printf("\n\nWARNING: Terminal colors have been disabled, view will be very limited.\n\n")
|
fmt.Printf("\n\nWARNING: Terminal colors have been disabled, view will be very limited.\n\n")
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -133,7 +133,7 @@ func buildEndpointFromInterface(iface net.Interface) (*Endpoint, error) {
|
||||||
for _, a := range addrs {
|
for _, a := range addrs {
|
||||||
address := a.String()
|
address := a.String()
|
||||||
if IPv4Validator.MatchString(address) {
|
if IPv4Validator.MatchString(address) {
|
||||||
if strings.ContainsRune(address, '/') {
|
if !strings.ContainsRune(address, '/') {
|
||||||
// plain ip
|
// plain ip
|
||||||
e.SetIP(address)
|
e.SetIP(address)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue