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

Endless loop in BracketNotationParser #10

Open
thuetter opened this issue Apr 27, 2020 · 5 comments · May be fixed by #28
Open

Endless loop in BracketNotationParser #10

thuetter opened this issue Apr 27, 2020 · 5 comments · May be fixed by #28
Assignees
Labels

Comments

@thuetter
Copy link
Collaborator

In case of an invalid input, the bracket notation parser may end up in an endless loop. More specifically, the while loop in function parse_single does not increase the iterator in case that match_str is no bracket.

Minimal example:
{a{b}c}
This causes an endless loop with match_str equal to c.

@remz1337
Copy link
Contributor

Has this been resolved already? Can't seem to reproduce (tested on both my Windows and CentOS machines) using the provided minimal example

@mateuszpawlik
Copy link
Collaborator

Thanks @remz1337. @thuetter will check it next week.

@thuetter
Copy link
Collaborator Author

thuetter commented Apr 24, 2023

I just checked and it seems like there is a workaround for this bug which prevents the nested loop. In lines 89-93, invalid characters are skipped which guarantees termination. However, the expected behaviour might exit with an appropriate error message. Needs some engineering.

@mateuszpawlik
Copy link
Collaborator

Do you mean these lines?

// Skip incorrect token.
if (consumed_token == false) {
++tokens_begin; // Advance tokens.
}

@thuetter
Copy link
Collaborator Author

Exactly.

@thuetter thuetter self-assigned this May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants