Base64: Catch NPE on bad input to main() decode

This commit is contained in:
zzz
2014-10-03 15:11:29 +00:00
parent a50afeb5d5
commit fff7fbe121

View File

@ -264,6 +264,8 @@ public class Base64 {
private static void decode(InputStream in, OutputStream out) throws IOException {
byte decoded[] = decode(new String(read(in)));
if (decoded == null)
throw new IOException("Invalid base 64 string");
out.write(decoded);
}