github-vet / github-vet/rangeloop-pointer-findings
luizalabs/sindico: controllers/watchdog/limits.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [luizalabs/sindico](https://www.github.com/luizalabs/sindico) at [controllers/watchdog/limits.go](https://github.com/luizalabs/sindico/blob/423073b0b98b293f76451da648b15901c60e65c4/controllers/watchdog/limits.go#L57-L64)
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 63 passes reference to lim to third-party code
[Click here to see the code in its original context.](https://github.com/luizalabs/sindico/blob/423073b0b98b293f76451da648b15901c60e65c4/controllers/watchdog/limits.go#L57-L64)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for _, lim := range lims.Items {
ns := lim.ObjectMeta.Namespace
if re != nil && re.MatchString(ns) {
l.logger.Debug("skip ns regex", "ns", ns)
continue
}
l.updateLimits(cfg, &lim)
}
```
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 {
"(updateLimits, 2)" -> {"(Update, 1)";}
"(Update, 1)" -> {"(UpdateWithEventNamespace, 1)";}
"(UpdateWithEventNamespace, 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: 423073b0b98b293f76451da648b15901c60e65c4
Contributor guide
No contributing guide indexed for this repository
Research direction
Review controllers/watchdog/limits.go at lines 57-64, starting with the range loop and the call to l.updateLimits(cfg, &lim). Follow the analyzer’s listed path through Update and UpdateWithEventNamespace, then classify the finding as Bug, Mitigated, or Desirable Behavior using the linked project guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100