-
Notifications
You must be signed in to change notification settings - Fork 232
JCR-5226: Base64 decoder does not handle lack of padding correctly #332
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
Conversation
…tly - failing test case
…tly - minimal change to handle missing padding (instead of returning garbage)
kwin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| // handle missing padding gracefully, inspired by | ||
| // https://datatracker.ietf.org/doc/html/rfc7515#appendix-C | ||
| if (posChunk == 1) { | ||
| throw new IllegalArgumentException("specified data is not base64 encoded"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any test for this IAE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TDB
The weird thing is that in case of IAEs, the (existing) code does return the input string (who knows why)
|
... while we're at it, we may want to improve the Javadoc. |
|
There are more bugs (decoding "a=b" etc); but these fall into the category "garbage in, garbage out", not "correct input, garbage out). |
|



No description provided.