appliedgocode / goman

The missing man page for Go binaries. Goman fetches the repo's readme as a man page replacement.
Other
123 stars 3 forks source link

goman go - panic: runtime error: slice bounds out of range #1

Closed egorse closed 7 years ago

egorse commented 7 years ago

Just some wild try

$ goman go
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.getRawReadmeURL(0xc42041f212, 0x6, 0xc42041f200, 0x6, 0xc42041f212, 0x6)
    /home/egorse/Projects/src/github.com/christophberger/goman/goman.go:321 +0x284
main.findRemoteReadme(0xc42041f212, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x92ef00, 0xc42041f420)
    /home/egorse/Projects/src/github.com/christophberger/goman/goman.go:261 +0xd1
main.findReadme(0xc42041f212, 0x6, 0xc42041f212, 0x6, 0x0, 0x0, 0x532857, 0xc420019410, 0x1)
    /home/egorse/Projects/src/github.com/christophberger/goman/goman.go:180 +0x4b
main.main()
    /home/egorse/Projects/src/github.com/christophberger/goman/goman.go:90 +0x708
christophberger commented 7 years ago

Thanks for reporting - I can repro this at my end. The go command seems special - I have not seen any panic with any binary I tested.

christophberger commented 7 years ago

Wow, what a stupid bug. Forgot to ensure the length of a string before slicing.

christophberger commented 7 years ago

Fixed by commit 4d6055f23975b2039ef1de3ce717210a910a7a9c