github-vet / github-vet/rangeloop-pointer-findings

box/kube-iptables-tailer: event/poster.go; 26 LoC

Open
#17,316 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [box/kube-iptables-tailer](https://www.github.com/box/kube-iptables-tailer) at [event/poster.go](https://github.com/box/kube-iptables-tailer/blob/e683b8a0c169453884d98b6a54eb63e9720e68ef/event/poster.go#L65-L90)

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.

>

[Click here to see the code in its original context.](https://github.com/box/kube-iptables-tailer/blob/e683b8a0c169453884d98b6a54eb63e9720e68ef/event/poster.go#L65-L90)

Click here to show the 26 line(s) of Go which triggered the analyzer.

```go
for packetDrop := range packetDropCh {
// setup a backoff and retry mechanism
retryOperation := func() error {
return poster.handle(packetDrop)
}

errorNotifier := func(err error, t time.Duration) {
zap.L().Error(
"Error retrying packet drop handling, backing off",
zap.Object("packet_drop", &packetDrop),
zap.Float64("retry", t.Seconds()),
zap.String("error", err.Error()),
)
}

if err := backoff.RetryNotify(retryOperation, poster.backoff, errorNotifier); err != nil {
zap.L().Error(
"Error retrying packet drop handling, giving up",
zap.Object("packet_drop", &packetDrop),
zap.String("error", err.Error()),
)
}

// reset the backoff to handle the next packet drop
poster.backoff.Reset()
}

```

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.

No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.

root signature {Object 2} was not found in the callgraph; reference was passed directly 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: e683b8a0c169453884d98b6a54eb63e9720e68ef

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with event/poster.go at lines 65-90 and read the range-loop handling around poster.handle and the backoff retry. Review the linked commit and the analyzer details to determine whether this is a Bug, Mitigated, or Desirable Behavior. Done means adding the appropriate reaction classification to the issue.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.