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

Harden base64 decode. #316

Merged
merged 1 commit into from Jul 25, 2016

Conversation

Projects
None yet
1 participant
@dduponchel
Collaborator

dduponchel commented Jul 18, 2016

A common mistake is to put a data url (from a canvas for example) as a base64
content. In that case, we got a float value as the computed length of the
result and creating an Uint8Array threw an error.

This commit hardens the base64 decode: if the computed length is not an
integer or if the content looks like a data url, a better error is
thrown (instead of "TypeError: invalid arguments").

Harden base64 decode.
A common mistake is to put a data url (from a canvas for example) as a base64
content. In that case, we got a float value as the computed length of the
result and creating an Uint8Array threw an error.

This commit hardens the base64 decode: if the computed length is not an
integer or if the content looks like a data url, a better error is
thrown (instead of "TypeError: invalid arguments").

@dduponchel dduponchel merged commit b1156b5 into Stuk:master Jul 25, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dduponchel dduponchel deleted the dduponchel:base64_decode branch Jul 25, 2016

@dduponchel dduponchel referenced this pull request Aug 2, 2016

Merged

Release v3.1.0 #326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment