Debug: stop base64 decode after > 10 bad bytes

pull/210/head
M66B 2 years ago
parent 4413bd0af9
commit 348b57bc4e

@ -335,6 +335,7 @@ public class BASE64DecoderStream extends FilterInputStream {
*/
private int getByte() throws IOException {
int c;
int bad = 0;
do {
if (input_pos >= input_len) {
try {
@ -353,6 +354,8 @@ public class BASE64DecoderStream extends FilterInputStream {
return -2;
// no, convert it
c = pem_convert_array[c];
if (c == -1 && ++bad > 10 && eu.faircode.email.BuildConfig.DEBUG)
return -1;
// loop until we get a legitimate byte
} while (c == -1);
return c;

Loading…
Cancel
Save