We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfa92b8 commit fe144d1Copy full SHA for fe144d1
pg/src/main/java/org/bouncycastle/gpg/SXprUtils.java
@@ -1,5 +1,6 @@
1
package org.bouncycastle.gpg;
2
3
+import java.io.EOFException;
4
import java.io.IOException;
5
import java.io.InputStream;
6
@@ -51,7 +52,10 @@ static byte[] readBytes(InputStream in, int ch)
51
52
53
byte[] data = new byte[len];
54
- Streams.readFully(in, data);
55
+ if (len != Streams.readFully(in, data))
56
+ {
57
+ throw new EOFException();
58
+ }
59
60
return data;
61
}
@@ -95,7 +99,7 @@ static void skipCloseParenthesis(InputStream in)
95
99
int ch = in.read();
96
100
if (ch != ')')
97
101
{
98
- throw new IOException("unknown character encountered");
102
+ throw new IOException("unknown character encountered: " + (char)ch);
103
104
105
0 commit comments