Skip to content

Commit 28c79fb

Browse files
committed
Another base64 bug
1 parent 2456267 commit 28c79fb

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/forgiving_base64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<F, E> Decoder<F, E> where F: FnMut(&[u8]) -> Result<(), E> {
7676
}
7777

7878
if byte == b'=' {
79-
self.padding_symbols = self.padding_symbols.saturating_add(8);
79+
self.padding_symbols = self.padding_symbols.saturating_add(1);
8080
continue
8181
}
8282

tests/wpt.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,8 @@ fn collect_base64<F>(add_test: &mut F)
8888
Some(json_byte_array(expected))
8989
};
9090

91-
let should_panic = [
92-
"ab==",
93-
"ab\t\n\u{c}\r =\t\n\u{c}\r =\t\n\u{c}\r ",
94-
"abc=",
95-
].contains(&&*input);
91+
let known_failures = [];
92+
let should_panic = known_failures.contains(&&*input);
9693
add_test(
9794
format!("base64 {:?}", input),
9895
should_panic,

0 commit comments

Comments
 (0)