tillson / git-hound

Reconnaissance tool for GitHub code search. Scans for exposed API keys across all of GitHub, not just known repos and orgs.
MIT License
1.2k stars 187 forks source link

panic: runtime error: index out of range [0] with length 0 #39

Closed SAGEof6iixPATHS closed 2 years ago

SAGEof6iixPATHS commented 3 years ago

I ran This command echo "zapier.com" | git-hound --dig-files --dig-commits --many-results --threads 100 And got this error...

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/tillson/git-hound/cmd.getScanner(...)
        /root/tools/git-hound/cmd/root.go:112
github.com/tillson/git-hound/cmd.glob..func1(0xe8b580, 0xc00006cf50, 0x0, 0x5)
        /root/tools/git-hound/cmd/root.go:64 +0xb25
github.com/spf13/cobra.(*Command).execute(0xe8b580, 0xc0000201f0, 0x5, 0x5, 0xe8b580, 0xc0000201f0)
        /root/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:842 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xe8b580, 0xc000000180, 0x200000003, 0xc000000180)
        /root/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943 +0x336
github.com/spf13/cobra.(*Command).Execute(...)
        /root/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883
github.com/tillson/git-hound/cmd.Execute()
        /root/tools/git-hound/cmd/root.go:122 +0x36
main.main()
        /root/tools/git-hound/main.go:10 +0x25
thezakman commented 3 years ago

Got the same error.

Faizee-Asad commented 3 years ago

same error.

Faizee-Asad commented 3 years ago

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]: github.com/tillson/git-hound/cmd.getScanner(...) /root/Final_tool/git-hound/cmd/root.go:112 github.com/tillson/git-hound/cmd.glob..func1(0x104f640, 0x108a358, 0x0, 0x0) /root/Final_tool/git-hound/cmd/root.go:64 +0xb45 github.com/spf13/cobra.(Command).execute(0x104f640, 0xc0000202c0, 0x0, 0x0, 0x104f640, 0xc0000202c0) /root/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:842 +0x2c2 github.com/spf13/cobra.(Command).ExecuteC(0x104f640, 0x448b77, 0x100e000, 0xc000000180) /root/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943 +0x336 github.com/spf13/cobra.(*Command).Execute(...) /root/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883 github.com/tillson/git-hound/cmd.Execute() /root/Final_tool/git-hound/cmd/root.go:122 +0x36 main.main() /root/Final_tool/git-hound/main.go:10 +0x25

0xCC00FFEE commented 3 years ago

A quick workaround for this issue is to download and build the latest stable release (v1.3 at the time of writing this comment).

Debugging the issue, it seems that the root cause of the issue is the following commit: https://github.com/tillson/git-hound/commit/c9b91bac386e782b71da061c24e6bab2626d2ba9

More specifically, trying to access the first string value in the arguments' list at line 108 in the committed file cmd/root.go.