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

implement optional limit on token size #1045

Merged
merged 8 commits into from
Jan 28, 2023
Merged

implement optional limit on token size #1045

merged 8 commits into from
Jan 28, 2023

Conversation

lsf37
Copy link
Member

@lsf37 lsf37 commented Jan 28, 2023

New directive

%token_size_limit <limit>

where <limit> is a Java number literal or qualified identifier provides an optional hard limit on token length.

The scanner buffer will not be increased beyond this length limit and if a longer token is encountered the scanner with throw an EOFException.

This is for applications that require memory limits when parsing untrusted input.

Implements #197

@lsf37 lsf37 self-assigned this Jan 28, 2023
@lsf37 lsf37 added the enhancement Feature requests label Jan 28, 2023
@lsf37 lsf37 linked an issue Jan 28, 2023 that may be closed by this pull request
@lsf37 lsf37 added this to the 1.9.0 milestone Jan 28, 2023
lsf37 added 7 commits January 28, 2023 17:17
New directive

    %token_size_limit <limit>

where <limit> is a Java number literal or qualified identifier provides
an optional hard limit on token length.

The scanner buffer will not be increased beyond this length limit and
if a longer token is encountered the scanner with throw an EOFException.

This is for applications that require memory limits when parsing
untrusted input.

Implements #197
This means the new skeleton.nested can be used with JFlex 1.9.0, but
requires the interface functions zzCanGrow() and zzMaxBufferLen() to
be provided with JFLex <= 1.8.3.
@lsf37 lsf37 mentioned this pull request Jan 28, 2023
@lsf37 lsf37 linked an issue Jan 28, 2023 that may be closed by this pull request
@lsf37 lsf37 merged commit d7ceffd into master Jan 28, 2023
@lsf37 lsf37 deleted the buffer branch January 28, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on limits of current input Provide the ability to disable scanner buffer growth
1 participant