Bug in `string/aho_corasick` algorithm
guopenghui opened this issue · 2 comments
guopenghui commented
Rust/src/string/aho_corasick.rs
Line 80 in a5cf37c
It will cause computing overflow when pattern appear at head of string.
If i - len + 1 == 0
, i - len
will be -1
first, then panic.
Change to i + 1 - len
will solve this.
siriak commented
Thanks for reporting, could you make a PR with the proposed changes?
github-actions commented
This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.