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

feat: add from_reader_with_recursion_limit #84

Merged
merged 1 commit into from
May 29, 2023

Conversation

daviddrysdale
Copy link
Contributor

This change adds a from_reader_with_recursion_limit() variant of from_reader(), allowing the maximum recursion limit to be set explicitly.

Fixes #58 which asks for the ability to set a higher recursion limit, but this is mainly intended for environments where the default limit of 256 is too large (i.e. the stack gets exhausted before the limit is hit).

@daviddrysdale daviddrysdale requested a review from a team as a code owner May 17, 2023 18:04
@daviddrysdale daviddrysdale requested a review from npmccallum May 17, 2023 18:04
@enarxbot enarxbot added the enhancement New feature or request label May 17, 2023
@rjzak
Copy link
Member

rjzak commented May 29, 2023

Please re-word the commit message so the conventional commit checker passes:

 Error: 1 of the pull request's commits are not valid Conventional Commits
❌ Commit (c6825a20): feat: add from_reader_with_recursion_limit
  Error: [C024] A colon is required in git-trailers
  Fixes #58 which asks for the ability to set a higher recursion limit,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       : #58 which asks for the ability to set a higher recursion limit,

This change adds a from_reader_with_recursion_limit() variant of
from_reader(), allowing the maximum recursion limit to be set
explicitly.

Fixes: enarx#58 which asks for the ability to set a higher recursion limit,
but this is mainly intended for environments where the default limit
of 256 is too large (i.e. the stack gets exhausted before the limit is
hit).

Signed-off-by: David Drysdale <[email protected]>
@daviddrysdale
Copy link
Contributor Author

I couldn't get commisery to produce the same error locally (maybe I need some config file?) but I tried adding the colon suggested by the error – hope that helps. Thanks!

@rjzak rjzak merged commit 25174b7 into enarx:main May 29, 2023
@daviddrysdale daviddrysdale deleted the recurse-limit branch May 29, 2023 18:41
jrguzman-ms pushed a commit to msft-mirror-aosp/platform.external.rust.crates.ciborium that referenced this pull request Jun 23, 2023
For Trusty we want to be able to reduce the recursion limit for CBOR
parsing, as the default is bigger than the normal stack limit in Trusty.

This change has been added upstream as commit 25174b7bc31f ("feat: add
from_reader_with_recursion_limit") from
enarx/ciborium#84, so it should be available in
the next release of ciborium.

Test: TreeHugger, local Trusty fuzzing build
Change-Id: Ie1ca9affc26927b2d83722b705d1e4c10200939f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature]: Allow higher recursion limits.
3 participants