github-vet / github-vet/rangeloop-pointer-findings
LoopringSecondary/relay: extractor/extractor.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [LoopringSecondary/relay](https://www.github.com/LoopringSecondary/relay) at [extractor/extractor.go](https://github.com/LoopringSecondary/relay/blob/491e0883010196dc869e90957c47eeb29001ef5f/extractor/extractor.go#L285-L302)
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 300 may store a reference to evtLog
[Click here to see the code in its original context.](https://github.com/LoopringSecondary/relay/blob/491e0883010196dc869e90957c47eeb29001ef5f/extractor/extractor.go#L285-L302)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for _, evtLog := range receipt.Logs {
event, ok := l.processor.GetEvent(evtLog)
if !ok {
l.debug("extractor,process event,tx:%s,unsupported contract event", tx.Hash)
continue
}
data := hexutil.MustDecode(evtLog.Data)
if nil != data && len(data) > 0 {
if err := event.CAbi.Unpack(event.Event, event.Name, data, abi.SEL_UNPACK_EVENT); nil != err {
log.Errorf("extractor,process event,tx:%s unpack event error:%s", tx.Hash, err.Error())
continue
}
}
event.FullFilled(tx, &evtLog, receipt.GasUsed.BigInt(), blockTime, methodName)
eventemitter.Emit(event.Id.Hex(), event)
}
```
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:
digraph G {
"(FullFilled, 5)" -> {"(setTxInfo, 4)";}
"(setTxInfo, 4)" -> {}
}
```
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: 491e0883010196dc869e90957c47eeb29001ef5f
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.