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

Recover when go-diff lib panics parsing large commits; index out of range #25

Closed
hahanov opened this issue May 19, 2020 · 2 comments
Closed

Comments

@hahanov
Copy link

hahanov commented May 19, 2020

Describe the bug
Primarily. Greetings, wonderful program, thanks for the work.

Now to the point. I have about 3,000 subdomains. And on ~ 120 domain the program every time gives an error, the list did not change.

Desktop (please complete the following information):

  • Kali KDE
  • Version release last

Error

git-hound --dig-files --dig-commits --many-results --threads 70 --subdomain-file ./results/subdomain.txt 
...
[*] Searching 26 pages of results for 'domain.white.com'...
panic: runtime error: index out of range

goroutine 4388 [running]:
github.com/sergi/go-diff/diffmatchpatch.(*DiffMatchPatch).DiffCharsToLines(0xc0173bf108, 0xc01a2ed320, 0x2, 0x4, 0xc00df14000, 0xfacd, 0x12800, 0x4800, 0xc01a2ed320, 0x2)
        /Users/tillsongalloway/.go/pkg/mod/github.com/sergi/go-diff@v1.1.0/diffmatchpatch/diff.go:452 +0x31d
github.com/go-git/go-git/v5/utils/diff.DoWithTimeout(0xc00694c000, 0x6bcb8, 0xc0176e4000, 0x2a9744, 0x34630b8a000, 0x0, 0x6d12, 0x94)
        /Users/tillsongalloway/.go/pkg/mod/github.com/go-git/go-git/v5@v5.0.0/utils/diff/diff.go:37 +0x1b9
github.com/go-git/go-git/v5/utils/diff.Do(...)
        /Users/tillsongalloway/.go/pkg/mod/github.com/go-git/go-git/v5@v5.0.0/utils/diff/diff.go:22
github.com/go-git/go-git/v5/plumbing/object.filePatchWithContext(0xc9f1c0, 0xc0000c8068, 0xc015a7ee80, 0xc01a434000, 0xc002a4d270, 0x0, 0xc002f8f120)
        /Users/tillsongalloway/.go/pkg/mod/github.com/go-git/go-git/v5@v5.0.0/plumbing/object/patch.go:68 +0x22b
github.com/go-git/go-git/v5/plumbing/object.getPatchContext(0xc9f1c0, 0xc0000c8068, 0x0, 0x0, 0xc0173bf3c8, 0x1, 0x1, 0x3d, 0xb8c4bf, 0x4)
        /Users/tillsongalloway/.go/pkg/mod/github.com/go-git/go-git/v5@v5.0.0/plumbing/object/patch.go:38 +0xd2
github.com/go-git/go-git/v5/plumbing/object.(*Change).PatchContext(...)
        /Users/tillsongalloway/.go/pkg/mod/github.com/go-git/go-git/v5@v5.0.0/plumbing/object/change.go:93
github.com/go-git/go-git/v5/plumbing/object.(*Change).Patch(...)
        /Users/tillsongalloway/.go/pkg/mod/github.com/go-git/go-git/v5@v5.0.0/plumbing/object/change.go:85
github.com/tillson/git-hound/internal/app.ScanDiff(0xc0198044b0, 0xc007dbd180, 0xc00153743f, 0x19, 0xc001537487, 0x1c, 0xc00061e380, 0x3d, 0xb8c4bf, 0x4, ...)
        /Users/tillsongalloway/.go/src/github.com/tillson/git-hound/internal/app/dig.go:237 +0x14c
github.com/tillson/git-hound/internal/app.digHelper.func2(0xc01a6121e0, 0xc01a6121e0, 0x0)
        /Users/tillsongalloway/.go/src/github.com/tillson/git-hound/internal/app/dig.go:195 +0x16c
github.com/go-git/go-git/v5/plumbing/object.(*commitPreIterator).ForEach(0xc00407e030, 0xc001744e80, 0x1a9e93517149b739, 0xec0df0e8532b2730)
        /Users/tillsongalloway/.go/pkg/mod/github.com/go-git/go-git/v5@v5.0.0/plumbing/object/commit_walker.go:105 +0x62
github.com/tillson/git-hound/internal/app.digHelper(0xc00153743f, 0x19, 0xc001537487, 0x1c, 0xc00061e380, 0x3d, 0xb8c4bf, 0x4, 0xc000238e33, 0x10, ...)
        /Users/tillsongalloway/.go/src/github.com/tillson/git-hound/internal/app/dig.go:185 +0x947
github.com/tillson/git-hound/internal/app.Dig.func1(0xc0005786c0, 0xc00153743f, 0x19, 0xc001537487, 0x1c, 0xc00061e380, 0x3d, 0xb8c4bf, 0x4, 0xc000238e33, ...)
        /Users/tillsongalloway/.go/src/github.com/tillson/git-hound/internal/app/dig.go:35 +0x60
created by github.com/tillson/git-hound/internal/app.Dig
        /Users/tillsongalloway/.go/src/github.com/tillson/git-hound/internal/app/dig.go:34 +0xca

Hope to fix it.
Please.

Note
Did you know? https://www.sourcecon.com/how-to-find-almost-any-github-users-email-address/
-------------------------------------------------

Please tell me where to get the logs or cached files from scanning, because sometimes you need to see more code. + Sometimes it’s not visible where the code is at all

[*] Searching 1 page of Gist results for 'domain2.white.com' ...
[https://github.com/744701700/cf55559b055414ed193150e8bc85853a]
e="authenticity_token" value="Ydyr9fJjUt2Km3w3vvUpSaUnXEnEbPk9NuI9gbz9gU2v1zau
https://github.com/744701700/cf55559b055414ed193150e8bc85853a/blob/master/744701700/cf55559b055414ed193150e8bc85853a
ame="timestamp_secret" value="b6ce9c78f922452afc58c33ac09179bcca227cea7acc09268509e60e653f7991
https://github.com/744701700/cf55559b055414ed193150e8bc85853a/blob/master/744701700/cf55559b055414ed193150e8bc85853a
@hahanov
Copy link
Author

hahanov commented May 22, 2020

Just leave it here
GitLab-Red-Team/gitrob@c735767
sergi/go-diff#89

Although, I’m not sure that this error occurs precisely because of large commits.

@hahanov hahanov changed the title Large data set Panic: runtime error: index out of range Recover when go-diff lib panics parsing large commits; Panic: runtime error: index out of range May 22, 2020
@hahanov hahanov changed the title Recover when go-diff lib panics parsing large commits; Panic: runtime error: index out of range Recover when go-diff lib panics parsing large commits; index out of range May 22, 2020
@tillson
Copy link
Owner

tillson commented May 23, 2020

Thanks for the link, @hahanov.

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

No branches or pull requests

2 participants