Skip to content

Conversation

@filipefigcorreia
Copy link
Contributor

@filipefigcorreia filipefigcorreia commented May 16, 2017

This PR fixes a RangeError: Invalid array length error that can be thrown when decoding a Base64Binary.

It may also be worth to look into the latest version of the Base64Binary code that this was based on, and which is available here (and that was first introduced in this blog post).


Edit: On closer inspection, the value that I was trying to decode seems to be truncated/incomplete. Still, it may be worth to update the Base64Binary code to the one that I have linked to, as jsonix currently fails with an unclear error if can't decode a base64 value. For reference, this is the "weird" base64 value that I was trying to decode: BwABBJQ1gJDUCAAAAAAA=

@highsource highsource merged commit 708a72e into highsource:master Jun 27, 2017
highsource added a commit that referenced this pull request Jun 27, 2017
highsource added a commit that referenced this pull request Jun 27, 2017
@highsource
Copy link
Owner

I've applied your fix to the right place and added a test case.
I'm a bit reluctant to use the code you linked to as it uses typesafe arrays which aren't quite vanilla JS from my point of view.

@highsource highsource added the bug label Jun 27, 2017
@highsource highsource self-assigned this Jun 27, 2017
@highsource highsource added this to the 2.4.2 milestone Jun 27, 2017
@filipefigcorreia
Copy link
Contributor Author

Thanks.

I'm a bit reluctant to use the code you linked to as it uses typesafe arrays which aren't quite vanilla JS from my point of view.

I can live with this :-)

@filipefigcorreia filipefigcorreia deleted the bugfix/fix-rangeerror-when-decoding-base64 branch June 30, 2017 16:04
@highsource highsource self-requested a review March 18, 2019 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants