Skip to content

Fix a significant error (causes a hang) in PR 16208.#16371

Closed
Coises wants to merge 1 commit intonotepad-plus-plus:masterfrom
Coises:Fix-error-in-PR-16208
Closed

Fix a significant error (causes a hang) in PR 16208.#16371
Coises wants to merge 1 commit intonotepad-plus-plus:masterfrom
Coises:Fix-error-in-PR-16208

Conversation

@Coises
Copy link
Copy Markdown
Contributor

@Coises Coises commented Apr 3, 2025

The fix applied in PR #16208 to avoid a hang when using certain regular expressions with certain data resolved that issue but created a new one. Prior to PR #16208, when called (after a zero-length match at the end of the document) with the length of the document as argument, BoostRegexSearch::SearchParameters::nextCharacter returned one greater than the length of the document. PR #16208 did not account for that, and it fails to advance the match position after a zero-length match at the end of the document, thus causing an infinite loop. This change fixes that by assuring that when BoostRegexSearch::SearchParameters::nextCharacter is called, the return is always at least one greater than the argument. This will avoid the end-of-document failure while preserving the correct behavior in the cases PR #16208 fixed.

@chcg chcg added the bug label Apr 3, 2025
@donho donho self-assigned this Apr 4, 2025
@donho donho added the accepted label Apr 4, 2025
@donho donho closed this in f59777b Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants