fix(changelog): Avoid a regex StackOverflow#88
Conversation
Complex real-life commit messages could cause a StackOverflow for regex matching. While the exact cause has not been investigated, the issue disappears when changing the regex to not match the full commmit message (including the body), but only the title line. This should be sufficient as all users of `CommitInfo.message` only get the first line by calling `lineSequence().first()` anyway.
|
@jmongard, what do you think about also renaming |
|
It could be renamed. I had no special thought about it other than it containing the commit message. |
And even if so, the whole commit message (title and body) would still be available as |
See #89. |
For the record, here's an AI-generated explanation of the root cause: The Java uses a Nondeterministic Finite Automaton (NFA) execution engine, which relies on recursive method calls on the call stack to explore matching pathways and handle backtracking. Here is the exact culprit in your expression: Why it Fails on Your Text
|
Complex real-life commit messages could cause a StackOverflow for regex matching. While the exact cause has not been investigated, the issue disappears when changing the regex to not match the full commmit message (including the body), but only the title line. This should be sufficient as all users of
CommitInfo.messageonly get the first line by callinglineSequence().first()anyway.