github-vet / github-vet/rangeloop-pointer-findings
SmartMeshFoundation/Atmosphere: network/gomatrix/sync.go; 19 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [SmartMeshFoundation/Atmosphere](https://www.github.com/SmartMeshFoundation/Atmosphere) at [network/gomatrix/sync.go](https://github.com/SmartMeshFoundation/Atmosphere/blob/26483fe5bf42bf8b17fbef45c563ea431147bf42/network/gomatrix/sync.go#L75-L93)
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 77 may store a reference to event
[Click here to see the code in its original context.](https://github.com/SmartMeshFoundation/Atmosphere/blob/26483fe5bf42bf8b17fbef45c563ea431147bf42/network/gomatrix/sync.go#L75-L93)
Click here to show the 19 line(s) of Go which triggered the analyzer.
```go
for _, event := range roomData.State.Events {
event.RoomID = roomID
room.UpdateState(&event)
s.notifyListeners(&event)
//handle room aliases
if event.Type == "m.room.aliases" {
//log.Trace(fmt.Sprintf("eventxx %s", utils.StringInterface(event, 5)))
aliases, ok := event.Content["aliases"]
if ok {
//{
// "aliases": ["#photon_ropsten_discovery:transport01.smartmesh.cn"]
//}
arrayAliases, ok := aliases.([]interface{})
if ok && len(arrayAliases) > 0 {
room.Alias = arrayAliases[0].(string)
}
}
}
}
```
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 {
"(UpdateState, 1)" -> {}
}
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: 26483fe5bf42bf8b17fbef45c563ea431147bf42
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.