mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
fix: fixed a nil pointer dereference when wifi.show is called but the wifi module is not running (fixes #562)
This commit is contained in:
parent
3a4d730fce
commit
f8566d6020
1 changed files with 9 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue