github-vet / github-vet/rangeloop-pointer-findings
open-horizon/edge-sync-service: core/communications/mqttCommunication.go; 7 LoC
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [open-horizon/edge-sync-service](https://www.github.com/open-horizon/edge-sync-service) at [core/communications/mqttCommunication.go](https://github.com/open-horizon/edge-sync-service/blob/cceaa2269651f163b6955bfbc6dba4b6ecf6f418/core/communications/mqttCommunication.go#L1429-L1435)
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 client is reassigned at line 1432
[Click here to see the code in its original context.](https://github.com/open-horizon/edge-sync-service/blob/cceaa2269651f163b6955bfbc6dba4b6ecf6f418/core/communications/mqttCommunication.go#L1429-L1435)
Click here to show the 7 line(s) of Go which triggered the analyzer.
```go
for _, client := range communication.clients {
if client.name == group.GroupName {
communication.lock.Lock()
communication.orgToClient[group.OrgID] = &client
communication.lock.Unlock()
}
}
```
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: cceaa2269651f163b6955bfbc6dba4b6ecf6f418
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read core/communications/mqttCommunication.go around lines 1429-1435 and inspect the linked commit context first. Compare the analyzer's reported reassignment with the surrounding client lookup, then determine whether the behavior is a bug, mitigated, or desirable; done means recording that classification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100