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 2063 #2079

Merged
merged 2 commits into from
Feb 15, 2023
Merged

Fix 2063 #2079

merged 2 commits into from
Feb 15, 2023

Conversation

jwhear
Copy link
Contributor

@jwhear jwhear commented Feb 15, 2023

Resolves #2063.

When padding is missing, the calcSizeForSlice function returns a InvalidPadding error. When we catch this we need to allow for up to 2 more bytes of decoded output. It's OK to overestimate because this length should only be used to allocate a buffer and the actual decoded length will be used to slice once decoded.

@jwhear jwhear marked this pull request as ready for review February 15, 2023 19:49
@jwhear jwhear changed the title WIP: Fix 2063 Fix 2063 Feb 15, 2023
@Jarred-Sumner
Copy link
Collaborator

Thank you

@Jarred-Sumner Jarred-Sumner merged commit e67b4e7 into oven-sh:main Feb 15, 2023
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.

Buffer.from('str', 'base64') missing the last byte
2 participants