Bug: pattern length will visit illegal address in hs_compile_lit_multi
Open
- Dominant language
- C++
- Stars
- 5.5k
- Forks
- 816
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 2
Description
in function addLitExpression:
// Ensure that our pattern isn't too long (in characters).
if (strlen(expression) > cc.grey.limitPatternLength) {
throw CompileError("Pattern length exceeds limit.");
}
the literal pattern maybe not ended with '\0', so strlen(expression) will visit the illegal address.
maybe "strlen(expression) " should change to expLength which is user defined.
please check this bug
Contributor guide
Assessment
This issue has not been assessed yet.