github-vet / github-vet/rangeloop-pointer-findings
OperatorFoundation/shapeshifter-dispatcher: modes/pt_socks5/pt_socks5.go; 23 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [OperatorFoundation/shapeshifter-dispatcher](https://www.github.com/OperatorFoundation/shapeshifter-dispatcher) at [modes/pt_socks5/pt_socks5.go](https://github.com/OperatorFoundation/shapeshifter-dispatcher/blob/78f71123a9a068e2e6d728dd4e1fb976e645cfd8/modes/pt_socks5/pt_socks5.go#L136-L158)
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.
> range-loop variable bindaddr used in defer or goroutine at line 147
[Click here to see the code in its original context.](https://github.com/OperatorFoundation/shapeshifter-dispatcher/blob/78f71123a9a068e2e6d728dd4e1fb976e645cfd8/modes/pt_socks5/pt_socks5.go#L136-L158)
Click here to show the 23 line(s) of Go which triggered the analyzer.
```go
for _, bindaddr := range ptServerInfo.Bindaddrs {
name := bindaddr.MethodName
// Deal with arguments.
listen, parseError := pt_extras.ArgsToListener(name, stateDir, options)
if parseError != nil {
return false
}
go func() {
for {
transportLn := listen(bindaddr.Addr.String())
log.Infof("%s - registered listener: %s", name, log.ElideAddr(bindaddr.Addr.String()))
modes.ServerAcceptLoop(name, transportLn, &ptServerInfo, serverHandler)
transportLnErr := transportLn.Close()
if transportLnErr != nil {
log.Errorf("Listener close error: %s", transportLnErr.Error())
}
}
}()
launched = true
}
```
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: 78f71123a9a068e2e6d728dd4e1fb976e645cfd8
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.