Skip to content
Permalink
Browse files

fix: fixed a nil pointer dereference when wifi.show is called but the…

… wifi module is not running (fixes #562)
  • Loading branch information...
evilsocket committed May 1, 2019
1 parent 3a4d730 commit f8566d6020f3aae0afc8942623cb576f00a716ad
Showing with 9 additions and 1 deletion.
  1. +9 −1 modules/wifi/wifi_show.go
@@ -10,6 +10,7 @@ import (

"github.com/bettercap/bettercap/modules/net_recon"
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/session"

"github.com/dustin/go-humanize"

@@ -315,6 +316,10 @@ func (mod *WiFiModule) showStatusBar() {
}

func (mod *WiFiModule) Show() (err error) {
if mod.Running() == false {
return session.ErrAlreadyStopped(mod.Name())
}

var stations []*network.Station
if err, stations = mod.doSelection(); err != nil {
return
@@ -343,8 +348,11 @@ func (mod *WiFiModule) Show() (err error) {
}

func (mod *WiFiModule) ShowWPS(bssid string) (err error) {
toShow := []*network.Station{}
if mod.Running() == false {
return session.ErrAlreadyStopped(mod.Name())
}

toShow := []*network.Station{}
if bssid == network.BroadcastMac {
for _, station := range mod.Session.WiFi.List() {
if station.HasWPS() {

0 comments on commit f8566d6

Please sign in to comment.
You can’t perform that action at this time.