github-vet / github-vet/rangeloop-pointer-findings
andybalholm/redwood: redwood.go; 9 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [andybalholm/redwood](https://www.github.com/andybalholm/redwood) at [redwood.go](https://github.com/andybalholm/redwood/blob/b58cccfbc4c641b931e0b455875a356db79ebaf3/redwood.go#L86-L94)
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 addr used in defer or goroutine at line 88
[Click here to see the code in its original context.](https://github.com/andybalholm/redwood/blob/b58cccfbc4c641b931e0b455875a356db79ebaf3/redwood.go#L86-L94)
Click here to show the 9 line(s) of Go which triggered the analyzer.
```go
for _, addr := range conf.TransparentAddresses {
go func() {
err := runTransparentServer(addr)
if err != nil && !strings.Contains(err.Error(), "use of closed") {
log.Fatalln("Error running transparent HTTPS proxy:", err)
}
}()
portsListening++
}
```
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: b58cccfbc4c641b931e0b455875a356db79ebaf3
Contributor guide
No contributing guide indexed for this repository
Research direction
Read redwood.go lines 86-94, starting with the range loop and its goroutine, and compare the analyzer warning with the surrounding proxy setup. Determine whether the captured addr can produce incorrect behavior, then classify the finding as Bug, Mitigated, or Desirable Behavior as requested; no test file is mentioned in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100