github-vet / github-vet/rangeloop-pointer-findings
theQRL/go-qrl: pkg/p2p/server.go; 5 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [theQRL/go-qrl](https://www.github.com/theQRL/go-qrl) at [pkg/p2p/server.go](https://github.com/theQRL/go-qrl/blob/7bd4979728d1a1c25632d3bbee2d4f3accc0fb38/pkg/p2p/server.go#L515-L519)
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.
> reference to p is reassigned at line 517
[Click here to see the code in its original context.](https://github.com/theQRL/go-qrl/blob/7bd4979728d1a1c25632d3bbee2d4f3accc0fb38/pkg/p2p/server.go#L515-L519)
Click here to show the 5 line(s) of Go which triggered the analyzer.
```go
for _, p := range srv.peersInfo.PeersInfo {
if _, ok := peers[p.IP]; !ok {
peers[p.IP] = &p
}
}
```
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: 7bd4979728d1a1c25632d3bbee2d4f3accc0fb38
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with pkg/p2p/server.go at lines 515-519 in commit 7bd4979728d1a1c25632d3bbee2d4f3accc0fb38. Read the surrounding peer-processing code and investigate the analyzer's report that the range variable p is referenced after reassignment. Done requires deciding whether this is a bug, mitigated, or desirable behavior and recording the classification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100