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

Failure on non-ascii input #278

Open
2 tasks done
kian99 opened this issue May 7, 2024 · 1 comment
Open
2 tasks done

Failure on non-ascii input #278

kian99 opened this issue May 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kian99
Copy link

kian99 commented May 7, 2024

Thank you for creating the issue!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of woke v0.19.0
When running woke on a file with non-ascii characters, one encounters a runtime error about index out of bounds.
panic: runtime error: index out of range [598] with length 598

goroutine 485 [running]:
github.com/get-woke/woke/pkg/rule.maskInlineIgnore({0xc00017fb80, 0x268})
        /home/kian/go/pkg/mod/github.com/get-woke/woke@v0.19.0/pkg/rule/rule.go:215 +0xea
github.com/get-woke/woke/pkg/rule.(*Rule).FindMatchIndexes(0xc0003183f0, {0xc00017fb80?, 0xc0000b8d20?})
        /home/kian/go/pkg/mod/github.com/get-woke/woke@v0.19.0/pkg/rule/rule.go:36 +0x85
github.com/get-woke/woke/pkg/result.FindResults(0xc0003183f0, {0x7ffe53a39e73, 0x1a}, {0xc00017fb80, 0x268}, 0x71)
        /home/kian/go/pkg/mod/github.com/get-woke/woke@v0.19.0/pkg/result/lineresult.go:48 +0x65
github.com/get-woke/woke/pkg/parser.(*Parser).generateFileFindings(0xc0004ee5d0, 0xc000762008)
        /home/kian/go/pkg/mod/github.com/get-woke/woke@v0.19.0/pkg/parser/findings.go:92 +0xae5
github.com/get-woke/woke/pkg/parser.(*Parser).generateFileFindingsFromFilename(0x0?, {0x7ffe53a39e73?, 0x0?})
        /home/kian/go/pkg/mod/github.com/get-woke/woke@v0.19.0/pkg/parser/findings.go:24 +0xb1
github.com/get-woke/woke/pkg/parser.(*Parser).processFiles.func1({0x7ffe53a39e73?, 0x0?})
        /home/kian/go/pkg/mod/github.com/get-woke/woke@v0.19.0/pkg/parser/parser.go:93 +0x6f
created by github.com/get-woke/woke/pkg/parser.(*Parser).processFiles
        /home/kian/go/pkg/mod/github.com/get-woke/woke@v0.19.0/pkg/parser/parser.go:90 +0x34
make: *** [Makefile:103: woke] Error 2

The error comes from maskInlineIgnore and I'll have a PR up shortly with a proposed fix.

@kian99 kian99 added the bug Something isn't working label May 7, 2024
Copy link
Contributor

github-actions bot commented May 7, 2024

👋 Thanks for submitting your first issue!

Please be sure to read and follow our Code of Conduct and Contributing guide.

⭐️ Is your org or open source project using woke? If so, we'd love for you to be included in the 'Who uses woke' list at https://github.com/get-woke/woke/blob/main/docs/about.md#who-uses-woke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant