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

OPT:from_base_le recursion depth check #279

Open
prestwich opened this issue Jul 29, 2023 · 0 comments
Open

OPT:from_base_le recursion depth check #279

prestwich opened this issue Jul 29, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@prestwich
Copy link
Collaborator

as of #277 from_base_le uses recursion to stack allocate the contents of an iterator. However, there's no check on the recursion depth, allowing arbitrary-length iterators to be unpacked onto the stack. Extremely large iterators will overflow the stack this way. It also may unpack far more iterator items than the Uint can fit

  • Compute the maximum iterations using BITS and base
  • Pass a recursion depth and increment at each recursing layer
  • Once the recursion has reached a depth where the target BITS cannot fit the number of digits in base, return an error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant