{"action":"created","issue":{"url":"https://api.github.com/repos/GoASTScanner/gas/issues/84","repository_url":"https://api.github.com/repos/GoASTScanner/gas","labels_url":"https://api.github.com/repos/GoASTScanner/gas/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/GoASTScanner/gas/issues/84/comments","events_url":"https://api.github.com/repos/GoASTScanner/gas/issues/84/events","html_url":"https://github.com/GoASTScanner/gas/issues/84","id":189234700,"number":84,"title":"Hardcoded credentials panic","user":{"login":"csstaub","id":639883,"avatar_url":"https://avatars.githubusercontent.com/u/639883?v=3","gravatar_id":"","url":"https://api.github.com/users/csstaub","html_url":"https://github.com/csstaub","followers_url":"https://api.github.com/users/csstaub/followers","following_url":"https://api.github.com/users/csstaub/following{/other_user}","gists_url":"https://api.github.com/users/csstaub/gists{/gist_id}","starred_url":"https://api.github.com/users/csstaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csstaub/subscriptions","organizations_url":"https://api.github.com/users/csstaub/orgs","repos_url":"https://api.github.com/users/csstaub/repos","events_url":"https://api.github.com/users/csstaub/events{/privacy}","received_events_url":"https://api.github.com/users/csstaub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-14T21:43:21Z","updated_at":"2016-11-14T23:04:22Z","closed_at":null,"body":"Running on a large repo, getting this panic from the hardcoded credentials check.\r\n\r\nThis is from revision 93016846d28840b0d101431716f317f0a0ee0a88.\r\n\r\n```\r\npanic: runtime error: index out of range\r\n\r\ngoroutine 1 [running]:\r\npanic(0x2b9ba0, 0xc420012240)\r\n\t/usr/local/go/src/runtime/panic.go:500 +0x1a1\r\ngithub.com/GoASTScanner/gas/rules.(*Credentials).matchGenDecl(0xc4201827e0, 0xc4206a7580, 0xc42008e1c0, 0xa40000c4206f2f80, 0x4, 0xc42008cb00)\r\n\t/Users/cs/src/go/src/github.com/GoASTScanner/gas/rules/hardcoded_credentials.go:62 +0x23e\r\ngithub.com/GoASTScanner/gas/rules.(*Credentials).Match(0xc4201827e0, 0x459ea0, 0xc4206a7580, 0xc42008e1c0, 0x307101, 0x5, 0xffffffffffffffff)\r\n\t/Users/cs/src/go/src/github.com/GoASTScanner/gas/rules/hardcoded_credentials.go:34 +0x118\r\ngithub.com/GoASTScanner/gas/core.(*Analyzer).Visit(0xc42008e1b0, 0x459ea0, 0xc4206a7580, 0x4587e0, 0xc42008e1b0)\r\n\t/Users/cs/src/go/src/github.com/GoASTScanner/gas/core/analyzer.go:214 +0x277\r\ngo/ast.Walk(0x4587e0, 0xc42008e1b0, 0x459ea0, 0xc4206a7580)\r\n\t/usr/local/go/src/go/ast/walk.go:52 +0x63\r\ngo/ast.Walk(0x4587e0, 0xc42008e1b0, 0x5712e0, 0xc4207ce160)\r\n\t/usr/local/go/src/go/ast/walk.go:186 +0x32bf\r\ngo/ast.walkStmtList(0x4587e0, 0xc42008e1b0, 0xc42079f200, 0x14, 0x20)\r\n\t/usr/local/go/src/go/ast/walk.go:32 +0x89\r\ngo/ast.Walk(0x4587e0, 0xc42008e1b0, 0x459c20, 0xc420574c30)\r\n\t/usr/local/go/src/go/ast/walk.go:224 +0x1d48\r\ngo/ast.Walk(0x4587e0, 0xc42008e1b0, 0x56dcc0, 0xc420574c60)\r\n\t/usr/local/go/src/go/ast/walk.go:344 +0xf03\r\ngo/ast.walkDeclList(0x4587e0, 0xc42008e1b0, 0xc4201f3080, 0x2, 0x2)\r\n\t/usr/local/go/src/go/ast/walk.go:38 +0x89\r\ngo/ast.Walk(0x4587e0, 0xc42008e1b0, 0x459e20, 0xc420322d00)\r\n\t/usr/local/go/src/go/ast/walk.go:353 +0x29e4\r\ngithub.com/GoASTScanner/gas/core.(*Analyzer).process(0xc42008e1b0, 0xc42086a550, 0x42, 0x0, 0x0, 0x2800000000000001, 0x8)\r\n\t/Users/cs/src/go/src/github.com/GoASTScanner/gas/core/analyzer.go:137 +0x5b7\r\ngithub.com/GoASTScanner/gas/core.(*Analyzer).Process(0xc42008e1b0, 0xc42086a550, 0x42, 0x3, 0x495a01)\r\n\t/Users/cs/src/go/src/github.com/GoASTScanner/gas/core/analyzer.go:159 +0x55\r\nmain.main.func1(0xc42086a550, 0x42, 0x45d5a0, 0xc4202865b0, 0x0, 0x0, 0x0, 0x0)\r\n\t/Users/cs/src/go/src/github.com/GoASTScanner/gas/main.go:198 +0x15e\r\npath/filepath.walk(0xc42086a550, 0x42, 0x45d5a0, 0xc4202865b0, 0xc42019c000, 0x0, 0x0)\r\n\t/usr/local/go/src/path/filepath/path.go:351 +0x81\r\npath/filepath.walk(0xc420412a50, 0x2e, 0x45d5a0, 0xc4202864e0, 0xc42019c000, 0x0, 0x0)\r\n\t/usr/local/go/src/path/filepath/path.go:376 +0x344\r\npath/filepath.walk(0xc4203f08d0, 0x29, 0x45d5a0, 0xc4206c05b0, 0xc42019c000, 0x0, 0x0)\r\n\t/usr/local/go/src/path/filepath/path.go:376 +0x344\r\npath/filepath.walk(0xc420014004, 0x1e, 0x45d5a0, 0xc42017d5f0, 0xc42019c000, 0x0, 0x1)\r\n\t/usr/local/go/src/path/filepath/path.go:376 +0x344\r\npath/filepath.Walk(0xc420014004, 0x1e, 0xc42019c000, 0x0, 0xc420015e01)\r\n\t/usr/local/go/src/path/filepath/path.go:398 +0xd5\r\nmain.main()\r\n\t/Users/cs/src/go/src/github.com/GoASTScanner/gas/main.go:204 +0x12a5\r\n```\r\n\r\nThis is on a big repo, so I don't know exactly what's killing it yet, but I'll try to narrow it down and see if I can come up with a minimal example. "},"comment":{"url":"https://api.github.com/repos/GoASTScanner/gas/issues/comments/260492803","html_url":"https://github.com/GoASTScanner/gas/issues/84#issuecomment-260492803","issue_url":"https://api.github.com/repos/GoASTScanner/gas/issues/84","id":260492803,"user":{"login":"gcmurphy","id":222833,"avatar_url":"https://avatars.githubusercontent.com/u/222833?v=3","gravatar_id":"","url":"https://api.github.com/users/gcmurphy","html_url":"https://github.com/gcmurphy","followers_url":"https://api.github.com/users/gcmurphy/followers","following_url":"https://api.github.com/users/gcmurphy/following{/other_user}","gists_url":"https://api.github.com/users/gcmurphy/gists{/gist_id}","starred_url":"https://api.github.com/users/gcmurphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcmurphy/subscriptions","organizations_url":"https://api.github.com/users/gcmurphy/orgs","repos_url":"https://api.github.com/users/gcmurphy/repos","events_url":"https://api.github.com/users/gcmurphy/events{/privacy}","received_events_url":"https://api.github.com/users/gcmurphy/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T23:04:22Z","updated_at":"2016-11-14T23:04:22Z","body":"Perfect thanks!\r\n"}}
{"actor":{"display_login":"gcmurphy"}}