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

maxar-infrastructure/terratest: modules/oci/network.go; 12 LoC

Open
#12,300 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [maxar-infrastructure/terratest](https://www.github.com/maxar-infrastructure/terratest) at [modules/oci/network.go](https://github.com/maxar-infrastructure/terratest/blob/c5ca9ef8e4e66f723e40c8b4cab06f82310618cd/modules/oci/network.go#L39-L50)

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

[Click here to see the code in its original context.](https://github.com/maxar-infrastructure/terratest/blob/c5ca9ef8e4e66f723e40c8b4cab06f82310618cd/modules/oci/network.go#L39-L50)

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

```go
for _, vcnID := range vcnIDs {
request := core.ListSubnetsRequest{
CompartmentId: &compartmentID,
VcnId: &vcnID,
}
response, err := client.ListSubnets(context.Background(), request)
if err != nil {
return "", err
}

mapSubnetsByAvailabilityDomain(allSubnetIDs, response.Items)
}

```

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: c5ca9ef8e4e66f723e40c8b4cab06f82310618cd

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading modules/oci/network.go at lines 39-50 and the linked analyzer context. Check whether the reported reference to vcnID represents a real problem in the subnet-listing loop, then inspect nearby OCI networking code for the expected behavior. Done when the finding has been confirmed or dismissed and the appropriate classification is recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.