Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gosec panics while scannig the project with nil pointer dereference #746

Closed
C0rWin opened this issue Dec 22, 2021 · 1 comment · Fixed by #747
Closed

gosec panics while scannig the project with nil pointer dereference #746

C0rWin opened this issue Dec 22, 2021 · 1 comment · Fixed by #747

Comments

@C0rWin
Copy link

C0rWin commented Dec 22, 2021

Summary

While running gosec on the project the tool fails with panic. The stack trace is:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1231d3e]

goroutine 1 [running]:
go/token.(*File).Name(...)
        /usr/local/opt/go/libexec/src/go/token/position.go:113
github.com/securego/gosec.(*Analyzer).Check(0xc000164b40, 0xc0017eeb40)
        /Users/c0rwin/golang/pkg/mod/github.com/securego/gosec@v0.0.0-20200401082031-e946c8c39989/analyzer.go:202 +0x11e
github.com/securego/gosec.(*Analyzer).Process(0xc000164b40, {0x0, 0xc0000ae0b8, 0xc0010b4000}, {0xc0010b9000, 0x4ac, 0x3a})
        /Users/c0rwin/golang/pkg/mod/github.com/securego/gosec@v0.0.0-20200401082031-e946c8c39989/analyzer.go:140 +0x169
main.main()
        /Users/c0rwin/golang/pkg/mod/github.com/securego/gosec@v0.0.0-20200401082031-e946c8c39989/cmd/gosec/main.go:329 +0x7c5

gosec is compiled from the latest.

@C0rWin
Copy link
Author

C0rWin commented Dec 22, 2021

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant