github-vet / github-vet/rangeloop-pointer-findings
RackHD/voyager-rackhd-service: server/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 [RackHD/voyager-rackhd-service](https://www.github.com/RackHD/voyager-rackhd-service) at [server/server.go](https://github.com/RackHD/voyager-rackhd-service/blob/510a059bcd2447739ef1d21760f58df5e1bba1c1/server/server.go#L41-L45)
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 44 passes reference to m to third-party code
[Click here to see the code in its original context.](https://github.com/RackHD/voyager-rackhd-service/blob/510a059bcd2447739ef1d21760f58df5e1bba1c1/server/server.go#L41-L45)
Click here to show the 5 line(s) of Go which triggered the analyzer.
```go
for m := range deliveries {
log.Printf("got %dB delivery on exchange %s: [%v] %s", len(m.Body), m.Exchange, m.DeliveryTag, m.Body)
m.Ack(true)
go s.ProcessMessage(&m)
}
```
Click here to show extra information the analyzer produced.
```
No path was found through the callgraph that could lead to a function which writes a pointer argument.
The following graphviz dot graph describes paths through the callgraph that could lead to a function which passes a pointer to third-party code:
digraph G {
"(ProcessMessage, 1)" -> {"(processRackHDService, 1)";}
"(processRackHDService, 1)" -> {}
}
```
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: 510a059bcd2447739ef1d21760f58df5e1bba1c1
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with server/server.go lines 41-45 and trace ProcessMessage through processRackHDService, as shown in the analyzer call graph. Determine whether passing the range variable's address to the goroutine can cause incorrect behavior, then verify the finding is resolved while preserving message processing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100