github-vet / github-vet/rangeloop-pointer-findings
vasilax/atlantis15: server/events/vcs/azuredevops_client.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [vasilax/atlantis15](https://www.github.com/vasilax/atlantis15) at [server/events/vcs/azuredevops_client.go](https://github.com/vasilax/atlantis15/blob/270ebbe87a2f69150bd769f5c985f25ff1a5bc2c/server/events/vcs/azuredevops_client.go#L106-L123)
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 c was used in a composite literal at line 112
[Click here to see the code in its original context.](https://github.com/vasilax/atlantis15/blob/270ebbe87a2f69150bd769f5c985f25ff1a5bc2c/server/events/vcs/azuredevops_client.go#L106-L123)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for _, c := range comments {
commentType := "text"
parentCommentID := 0
prComment := azuredevops.Comment{
CommentType: &commentType,
Content: &c,
ParentCommentID: &parentCommentID,
}
prComments := []*azuredevops.Comment{&prComment}
body := azuredevops.GitPullRequestCommentThread{
Comments: prComments,
}
_, _, err := g.Client.PullRequests.CreateComments(g.ctx, owner, project, repoName, pullNum, &body)
if 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: 270ebbe87a2f69150bd769f5c985f25ff1a5bc2c
Contributor guide
No contributing guide indexed for this repository
Research direction
Read server/events/vcs/azuredevops_client.go around lines 106-123 and inspect how the Azure DevOps client uses the constructed comments. Determine whether the reported range-loop reference can produce incorrect comment content, then classify the finding as a bug, mitigated, or desirable behavior based on the observed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100