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

Fix bug where guess and decode would panic on memory alloc #7

Merged
merged 5 commits into from
Aug 27, 2024

Conversation

leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented Aug 27, 2024

What

Change the guess and decode fns so they set the maximum length of the input.

Why

When an input is passed that is not valid, it can cause the xdr lib to allocate more memory than can fit into system memory if a four byte block is interpreted as a length field and is set to a really large value. The xdr lib has a limiter where we can specify what the maximum length of the input xdr so that it will fail before trying to allocate more memory than there is even in the xdr lib. This changes uses that feature.

Close #5

Merging

This change is intended to merge to main after #6.

Base automatically changed from i5-1 to main August 27, 2024 02:51
@leighmcculloch leighmcculloch marked this pull request as ready for review August 27, 2024 02:51
@leighmcculloch leighmcculloch merged commit 995ad0d into main Aug 27, 2024
6 checks passed
@leighmcculloch leighmcculloch deleted the i5-2 branch August 27, 2024 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Guess errors with unreachable runtime error when valid XDR input
2 participants