github-vet / github-vet/rangeloop-pointer-findings
Grayda/go-orvibo: orvibo2.go; 7 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [Grayda/go-orvibo](https://www.github.com/Grayda/go-orvibo) at [orvibo2.go](https://github.com/Grayda/go-orvibo/blob/5a3e0ea1c395e36c0c17cef3042d6760490283b9/orvibo2.go#L118-L124)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first
issue it finds, so please do not limit your consideration to the contents of the below message.
> function call at line 122 may store a reference to d
[Click here to see the code in its original context.](https://github.com/Grayda/go-orvibo/blob/5a3e0ea1c395e36c0c17cef3042d6760490283b9/orvibo2.go#L118-L124)
Click here to show the 7 line(s) of Go which triggered the analyzer.
```go
for d := range Devices { // Loop over all devices we know about
if d.DeviceType != RF { // Obviously the RF switch isn't WiFi, so it has no MAC address, and therefore can't be subscribed to.
// We send a message to each socket. reverseMAC takes a MAC address and reverses each pair (e.g. AC CF 23 becomes CA FC 32)
sendMessage("636c", reverseMAC(Devices[d].MACAddress)+macPadding, Devices[d])
passMessage("subscribe", &d)
}
}
```
Click here to show extra information the analyzer produced.
```
The following graphviz dot graph describes paths through the callgraph that could lead to a function which writes a pointer argument:
digraph G {
"(passMessage, 2)" -> {}
}
No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: 5a3e0ea1c395e36c0c17cef3042d6760490283b9
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.