-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Handle invalid base64 in SRI #23410
Handle invalid base64 in SRI #23410
Conversation
try { | ||
return Base64.getDecoder().decode(data); | ||
} catch (IllegalArgumentException e) { | ||
throw new InvalidChecksumException("Invalid base64 " + data, e); |
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.
throw new InvalidChecksumException("Invalid base64 " + data, e); | |
throw new InvalidChecksumException("Invalid base64: " + data, e); |
Clarifies where the invalid base64 starts as it might be very invalid.
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.
I will put the value in quotes since that's what the other error messages in this file do.
Previously, invalid base64 would crash the Bazel server.
ccf0907
to
3322d6d
Compare
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.
Thanks for the fix!
@bazel-io fork 7.4.0 |
Previously, invalid base64 would crash the Bazel server. Closes bazelbuild#23410. PiperOrigin-RevId: 667624565 Change-Id: I7b6b834fd291e9a3dae59df88b29bb378e7663a3
Previously, invalid base64 would crash the Bazel server. Closes #23410. PiperOrigin-RevId: 667624565 Change-Id: I7b6b834fd291e9a3dae59df88b29bb378e7663a3 Commit 1b0ed28 --------- Co-authored-by: Benjamin Peterson <[email protected]> Co-authored-by: Yun Peng <[email protected]>
The changes in this PR have been included in Bazel 7.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. |
Previously, invalid base64 would crash the Bazel server.