github-vet / github-vet/rangeloop-pointer-findings
rbroggi/tlayer: sender/sender.go; 11 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [rbroggi/tlayer](https://www.github.com/rbroggi/tlayer) at [sender/sender.go](https://github.com/rbroggi/tlayer/blob/72f9e4f308184f03b381cafa8c8d86e1fa31820d/sender/sender.go#L32-L42)
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 33 may store a reference to pkgToSend
[Click here to see the code in its original context.](https://github.com/rbroggi/tlayer/blob/72f9e4f308184f03b381cafa8c8d86e1fa31820d/sender/sender.go#L32-L42)
Click here to show the 11 line(s) of Go which triggered the analyzer.
```go
for i, pkgToSend := range packs {
s.conn.SendData(&pkgToSend)
if (int32(i+1) % s.connParam.WinSize) == 0 {
ack, err := s.conn.ReceiveAck(s.connParam.RetransmissionTimeout)
for err != nil {
fmt.Printf("Sender: no acknowdedge received. Retransmitting\n")
ack, err = s.conn.ReceiveAck(s.connParam.RetransmissionTimeout)
}
fmt.Printf("Sender: acknowledge received %v\n", ack.SegIDX)
}
}
```
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: 72f9e4f308184f03b381cafa8c8d86e1fa31820d
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.