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

DenverGophers/talks: 2013-03/crypto/symmetric/marchat/server.go; 21 LoC

Open
#17,747 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 [DenverGophers/talks](https://www.github.com/DenverGophers/talks) at [2013-03/crypto/symmetric/marchat/server.go](https://github.com/DenverGophers/talks/blob/57f802d1bf598385680cc8c91b3dc09da89ae30f/2013-03/crypto/symmetric/marchat/server.go#L212-L232)

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 ifi is reassigned at line 225

[Click here to see the code in its original context.](https://github.com/DenverGophers/talks/blob/57f802d1bf598385680cc8c91b3dc09da89ae30f/2013-03/crypto/symmetric/marchat/server.go#L212-L232)

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

```go
for _, ifi := range interfaceList {
if loopback.MatchString(ifi.Name) {
continue
}
addrList, err := ifi.Addrs()
if err != nil {
fmt.Println("[!] couldn't load interface list: ",
err.Error())
os.Exit(1)
}
for _, addr := range addrList {
ip := parseAddr(addr.String())
if !ip.IsLoopback() {
netInterface = &ifi
break
}
}
if netInterface != nil {
break
}
}

```

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: 57f802d1bf598385680cc8c91b3dc09da89ae30f

Contributor guide

No contributing guide indexed for this repository

Research direction

Read 2013-03/crypto/symmetric/marchat/server.go around lines 212-232, focusing on the range loop and the assignment to netInterface. Compare the analyzer's report with the shown code, then leave the requested reaction classifying it as Bug, Mitigated, or Desirable Behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.