github-vet / github-vet/rangeloop-pointer-findings
OlarisTV/olaris-server: metadata/managers/metadata/series.go; 3 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [OlarisTV/olaris-server](https://www.github.com/OlarisTV/olaris-server) at [metadata/managers/metadata/series.go](https://github.com/OlarisTV/olaris-server/blob/a1be87885f4efefbe4f264d57e310d4a5b704b10/metadata/managers/metadata/series.go#L47-L49)
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 48 passes reference to episode to third-party code
[Click here to see the code in its original context.](https://github.com/OlarisTV/olaris-server/blob/a1be87885f4efefbe4f264d57e310d4a5b704b10/metadata/managers/metadata/series.go#L47-L49)
Click here to show the 3 line(s) of Go which triggered the analyzer.
```go
for _, episode := range db.FindEpisodesForSeason(season.ID) {
m.UpdateEpisodeMD(&episode)
}
```
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 {
"(UpdateEpisodeMD, 1)" -> {"(SaveEpisode, 1)";}
"(SaveEpisode, 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: a1be87885f4efefbe4f264d57e310d4a5b704b10
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with metadata/managers/metadata/series.go at lines 47-49, then read UpdateEpisodeMD and the SaveEpisode path shown in the analyzer output. Determine whether passing the range-loop variable's address is a real defect, mitigated, or desirable behavior, and classify the finding accordingly.
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
- 25/100