github-vet / github-vet/rangeloop-pointer-findings
blacktop/ipsw: pkg/dyld/objc.go; 21 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [blacktop/ipsw](https://www.github.com/blacktop/ipsw) at [pkg/dyld/objc.go](https://github.com/blacktop/ipsw/blob/0973525716a8abda60336bc0422054dd69a7f4fb/pkg/dyld/objc.go#L497-L517)
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 cfstr is reassigned at line 498
[Click here to see the code in its original context.](https://github.com/blacktop/ipsw/blob/0973525716a8abda60336bc0422054dd69a7f4fb/pkg/dyld/objc.go#L497-L517)
Click here to show the 21 line(s) of Go which triggered the analyzer.
```go
for idx, cfstr := range cfStrTypes {
image.ObjC.CFStrings[idx].CFString64T = &cfstr
if cfstr.Data == 0 {
return fmt.Errorf("unhandled cstring parse case where data is 0")
}
image.ObjC.CFStrings[idx].Name, err = f.GetCString(cfstr.Data & mask) // TODO use chain fixups
if err != nil {
return fmt.Errorf("failed to read cstring: %v", err)
}
image.ObjC.CFStrings[idx].Address = sec.Addr + uint64(idx*binary.Size(objc.CFString64T{}))
if err != nil {
return fmt.Errorf("failed to calulate cfstring vmaddr: %v", err)
}
if len(image.ObjC.CFStrings[idx].Name) > 0 {
f.AddressToSymbol[image.ObjC.CFStrings[idx].Address] = image.ObjC.CFStrings[idx].Name // TODO: check the mem consumption
// fmt.Printf(" %#x: %#v\n", cfstrings[idx].Address, cfstrings[idx].Name)
}
}
```
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: 0973525716a8abda60336bc0422054dd69a7f4fb
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.