github-vet / github-vet/rangeloop-pointer-findings
martinmr/gojsonld: flatteningApi.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [martinmr/gojsonld](https://www.github.com/martinmr/gojsonld) at [flatteningApi.go](https://github.com/martinmr/gojsonld/blob/ca860bac45a38096dd1992ac780d2cbbc9d38def/flatteningApi.go#L275-L290)
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 288 may store a reference to property
[Click here to see the code in its original context.](https://github.com/martinmr/gojsonld/blob/ca860bac45a38096dd1992ac780d2cbbc9d38def/flatteningApi.go#L275-L290)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for _, property := range keys {
value := elementMap[property]
// 6.11.1)
if strings.HasPrefix(property, "_:") {
property = idGenerator.
generateBlankNodeIdentifier(&property)
}
// 6.11.2)
if _, hasProperty := node[property]; !hasProperty {
tmpArray := make([]interface{}, 0)
node[property] = tmpArray
}
// 6.11.3)
generateNodeMap(value, nodeMap, activeGraph, id, &property,
nil, idGenerator)
}
```
Click here to show extra information the analyzer produced.
```
The following dot graph describes paths through the callgraph that could lead to a function which writes a pointer argument:
no paths found; call may have ended in third-party code; stay tuned for diagnostics
```
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: ca860bac45a38096dd1992ac780d2cbbc9d38def
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.