github-vet / github-vet/rangeloop-pointer-findings
JinhuaW/aliyun_ddns: main.go; 22 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [JinhuaW/aliyun_ddns](https://www.github.com/JinhuaW/aliyun_ddns) at [main.go](https://github.com/JinhuaW/aliyun_ddns/blob/0dbacc77cd1864768164d5daf1fe4fce2b6e7420/main.go#L111-L132)
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 v is reassigned at line 116
[Click here to see the code in its original context.](https://github.com/JinhuaW/aliyun_ddns/blob/0dbacc77cd1864768164d5daf1fe4fce2b6e7420/main.go#L111-L132)
Click here to show the 22 line(s) of Go which triggered the analyzer.
```go
for _, v := range response.DomainRecords.Record {
if rr == v.RR && v.Type == "AAAA" {
if record6 != nil {
delRecord(client, v.RecordId)
} else {
record6 = &v
if v.Value != ipv6_addr {
updateRecord(client, v.RecordId, domainName, "AAAA", rr, ipv6_addr)
}
}
}
if ipv4_addr != "" && rr == v.RR && v.Type == "A" {
if record4 != nil {
delRecord(client, v.RecordId)
} else {
record4 = &v
if v.Value != ipv4_addr {
updateRecord(client, v.RecordId, domainName, "A", rr, ipv4_addr)
}
}
}
}
```
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: 0dbacc77cd1864768164d5daf1fe4fce2b6e7420
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.