aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Justin Whear <justin.whear@gmail.com> 2023-02-15 12:58:53 -0800
committerGravatar GitHub <noreply@github.com> 2023-02-15 12:58:53 -0800
commite67b4e73b57d152c4897acd66cf1347cbdf20444 (patch)
tree071f6d23e2ed29080cc121c242f30feea4783aaa /src
parent95e727162bd4a73ab673cf76898ec22638cd306a (diff)
downloadbun-e67b4e73b57d152c4897acd66cf1347cbdf20444.tar.gz
bun-e67b4e73b57d152c4897acd66cf1347cbdf20444.tar.zst
bun-e67b4e73b57d152c4897acd66cf1347cbdf20444.zip
Fix 2063 (#2079)
Diffstat (limited to 'src')
-rw-r--r--src/base64/base64.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/base64/base64.zig b/src/base64/base64.zig
index a5a94200f..8173767bc 100644
--- a/src/base64/base64.zig
+++ b/src/base64/base64.zig
@@ -49,8 +49,9 @@ pub fn decodeLenUpperBound(len: usize) usize {
pub fn decodeLen(source: anytype) usize {
return zig_base64.standard.Decoder.calcSizeForSlice(source) catch {
- //fallback
- return source.len / 4 * 3;
+
+ //fallback; add 2 to allow for potentially missing padding
+ return source.len / 4 * 3 + 2;
};
}