github-vet / github-vet/rangeloop-pointer-findings
mozilla/sops: config/config.go; 14 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [mozilla/sops](https://www.github.com/mozilla/sops) at [config/config.go](https://github.com/mozilla/sops/blob/38b25bd449619e1d6da20e637702f7c73203aa44/config/config.go#L250-L263)
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.
> reference to r is reassigned at line 252
[Click here to see the code in its original context.](https://github.com/mozilla/sops/blob/38b25bd449619e1d6da20e637702f7c73203aa44/config/config.go#L250-L263)
Click here to show the 14 line(s) of Go which triggered the analyzer.
```go
for _, r := range conf.DestinationRules {
if r.PathRegex == "" {
dRule = &r
rule = &dRule.RecreationRule
break
}
if r.PathRegex != "" {
if match, _ := regexp.MatchString(r.PathRegex, filePath); match {
dRule = &r
rule = &dRule.RecreationRule
break
}
}
}
```
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: 38b25bd449619e1d6da20e637702f7c73203aa44
Contributor guide
No contributing guide indexed for this repository
Research direction
Open config/config.go at lines 250-263 in the referenced mozilla/sops commit and compare the range-loop references with the analyzer message. Read the surrounding uses of dRule and rule, then classify the finding as Bug, Mitigated, or Desirable Behavior using the linked rangeclosure-findings guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100