Closed hit0ri closed 6 years ago
Thanks, I made a change to fix it
Commit e11dc1a did not fixed it, still crashing for me. But after I modified the if statement below it works fine.
diff --git a/reverse.go b/reverse.go
index b893fe8..e816cdc 100644
--- a/reverse.go
+++ b/reverse.go
@@ -72,7 +72,7 @@ func ReverseScan(scanTime time.Duration) (sensors models.SensorData, err error)
continue
}
packet.RSSI = int(rssi)
- if i > len(packets) {
+ if i >= len(packets) {
packets = append(packets, packet)
} else {
packets[i] = packet
Should I open a new issue?
Having a similar (same?) problem with v3.3.2-1-gd1eb4ef.
2018-09-17 15:46:19 [INFO] main.go func1:222 working in passive mode
panic: runtime error: index out of range
goroutine 1 [running]:
main.ReverseScan(0x2a05f200, 0x1, 0xe836052f, 0x165, 0x7ea08768, 0x9, 0x7ea08755
, 0xa, 0x0, 0x0, ...)
/home/zns/code/find3-cli-scanner/reverse.go:119 +0xb20
main.reverseCapture(0x2b4e4c0, 0x1)
/home/zns/code/find3-cli-scanner/main.go:257 +0x558
main.main.func1(0x18b0210, 0x18b0210, 0x18c9bec)
/home/zns/code/find3-cli-scanner/main.go:222 +0x538
github.com/urfave/cli.HandleAction(0x3bb448, 0x45bdf0, 0x18b0210, 0x188e2a0, 0x0
)
/home/zns/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:490 +0xac
github.com/urfave/cli.(*App).Run(0x1800ee0, 0x1816150, 0xe, 0xe, 0x0, 0x0)
/home/zns/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:264 +0x3f0
main.main()
/home/zns/code/find3-cli-scanner/main.go:232 +0x920
I pushed a fix for this I believe
Indeed the tool seems stable now, active for two days without crashes. Thanks for the prompt response.
Hi. I'm experiencing frequent panics in
ReverseScan
functionHere's the example output of tshark that is causing a crash:
System info: go version go1.9.4 linux/amd64 find3-cli-scanner version: cc70e6a TShark (Wireshark) 2.4.5 (v2.4.5) Network controller: Intel Corporation Wireless 7260 (rev 73)