github-vet / github-vet/rangeloop-pointer-findings

yangkailc/bigtree-dns: provider/oci/oci.go; 9 LoC

Open
#13,471 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [yangkailc/bigtree-dns](https://www.github.com/yangkailc/bigtree-dns) at [provider/oci/oci.go](https://github.com/yangkailc/bigtree-dns/blob/68a8344d7be39e8ed3d427467893f7ccd35a4406/provider/oci/oci.go#L239-L247)

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 zoneID was used in a composite literal at line 242

[Click here to see the code in its original context.](https://github.com/yangkailc/bigtree-dns/blob/68a8344d7be39e8ed3d427467893f7ccd35a4406/provider/oci/oci.go#L239-L247)

Click here to show the 9 line(s) of Go which triggered the analyzer.

```go
for zoneID, ops := range opsByZone {
if _, err := p.client.PatchZoneRecords(ctx, dns.PatchZoneRecordsRequest{
CompartmentId: &p.cfg.CompartmentID,
ZoneNameOrId: &zoneID,
PatchZoneRecordsDetails: dns.PatchZoneRecordsDetails{Items: ops},
}); err != nil {
return err
}
}

```

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: 68a8344d7be39e8ed3d427467893f7ccd35a4406

Contributor guide

No contributing guide indexed for this repository

Research direction

Read provider/oci/oci.go around lines 239-247, then inspect how PatchZoneRecords uses ZoneNameOrId and how the range variable is referenced. Determine whether taking a pointer to zoneID can produce incorrect behavior in this call. Done means classifying the analyzer finding as Bug, Mitigated, or Desirable Behavior based on that context.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.