github-vet / github-vet/rangeloop-pointer-findings
minio/direct-csi: cmd/kubectl-direct_csi/remove-drives.go; 7 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [minio/direct-csi](https://www.github.com/minio/direct-csi) at [cmd/kubectl-direct_csi/remove-drives.go](https://github.com/minio/direct-csi/blob/e70429038f0a271db7f64467407e39b06ca93a6c/cmd/kubectl-direct_csi/remove-drives.go#L100-L106)
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 104 passes reference to drive to third-party code
[Click here to see the code in its original context.](https://github.com/minio/direct-csi/blob/e70429038f0a271db7f64467407e39b06ca93a6c/cmd/kubectl-direct_csi/remove-drives.go#L100-L106)
Click here to show the 7 line(s) of Go which triggered the analyzer.
```go
for _, drive := range drives.Items {
match, _ := regexp.Match(args[0], []byte(drive.Status.Path))
if match {
drive.Spec.DirectCSIOwned = false
directCSIClient.DirectCSIDrives().Update(ctx, &drive, metav1.UpdateOptions{})
}
}
```
Click here to show extra information the analyzer produced.
```
No path was found through the callgraph that could lead to a function which writes a pointer argument.
The following graphviz dot graph describes paths through the callgraph that could lead to a function which passes a pointer to third-party code:
digraph G {
"(Update, 3)" -> {}
}
```
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: e70429038f0a271db7f64467407e39b06ca93a6c
Contributor guide
No contributing guide indexed for this repository
Research direction
Open cmd/kubectl-direct_csi/remove-drives.go around lines 100-106 and inspect the range loop together with the DirectCSIDrives().Update call. Read the linked classification guidance, determine whether the analyzer finding is a Bug, Mitigated, or Desirable Behavior, and leave the corresponding reaction; completion is a classification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100