rustc-serialize
rustc-serialize copied to clipboard
Base64: invalid trailing characters when last line ending is near trailer
This
println!("{:?}", b"foob".to_base64(Config{line_length:Some(4), ..STANDARD}));
println!("{:?}", b"foob".to_base64(Config{line_length:Some(5), ..STANDARD}));
println!("{:?}", b"foob".to_base64(Config{line_length:Some(6), ..STANDARD}));
println!("{:?}", b"foob".to_base64(Config{line_length:Some(7), ..STANDARD}));
println!("{:?}", b"foob".to_base64(Config{line_length:Some(8), ..STANDARD}));
prints
"Zm9v\r\nYg=="
"Zm9vYg===="
"Zm9vYg===="
"Zm9vYg===="
"Zm9vYg=="
This is invalid for line lengths 5~7.
(I'm not expecting this to be fixed but I'm still filing the issue to create awareness)