github-vet / github-vet/rangeloop-pointer-findings
mF2C/SlaManagement: assessment/mf2c.go; 21 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [mF2C/SlaManagement](https://www.github.com/mF2C/SlaManagement) at [assessment/mf2c.go](https://github.com/mF2C/SlaManagement/blob/23ace0147261a77d505584ea23ec11059eba72c1/assessment/mf2c.go#L54-L74)
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 60 may store a reference to a
[Click here to see the code in its original context.](https://github.com/mF2C/SlaManagement/blob/23ace0147261a77d505584ea23ec11059eba72c1/assessment/mf2c.go#L54-L74)
Click here to show the 21 line(s) of Go which triggered the analyzer.
```go
for _, a := range agreements {
log.Printf("Evaluating agreement %s", a.Id)
if a.State == model.STARTED && a.Assessment == nil {
a.Assessment = new(model.Assessment)
}
var result = AssessAgreement(&a, ma, now)
log.Printf("Result: %v\n", result)
for _, v := range result.GetViolations() {
pv := &v
pv, err = mf2cRepo.CreateViolation(pv)
if err != nil {
log.Printf("Error creating violation: %v", err)
}
}
_, err = repo.UpdateAgreement(&a)
if err != nil {
log.Printf("Error updating agreement: %v", err)
}
}
```
Click here to show extra information the analyzer produced.
```
The following graphviz dot graph describes paths through the callgraph that could lead to a function which writes a pointer argument:
digraph G {
"(EvaluateAgreement, 3)" -> {"(Initialize, 1)";}
"(Initialize, 1)" -> {}
"(AssessAgreement, 3)" -> {"(EvaluateAgreement, 3)";}
}
No path was found through the callgraph that could lead to a function which passes a pointer 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: 23ace0147261a77d505584ea23ec11059eba72c1
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.