Skip to content

Commit fca2e71

Browse files
committed
make sure we hold a buffered reader so that the loop continues reading PEMs
internally readPEM makes the reader buffered but its not the same! change introduced in 0.9.8 at e25518f causing #67
1 parent 4b22d38 commit fca2e71

File tree

1 file changed

+2
-3
lines changed
  • src/main/java/org/jruby/ext/openssl/x509store

1 file changed

+2
-3
lines changed

src/main/java/org/jruby/ext/openssl/x509store/Lookup.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,8 @@ public int loadCertificateOrCRLFile(final String file, final int type) throws IO
302302

303303
final Object[] cached = certCache.get(file);
304304

305-
Reader reader = null;
305+
BufferedReader reader = null;
306306
try {
307-
308307
int count = 0;
309308
if ( cached != null ) {
310309
for ( int c = 0; c < cached.length; c++ ) {
@@ -320,7 +319,7 @@ else if ( cert instanceof CRL ) {
320319
}
321320
}
322321
else {
323-
reader = new InputStreamReader(wrapJRubyNormalizedInputStream(file));
322+
reader = new BufferedReader(new InputStreamReader(wrapJRubyNormalizedInputStream(file)));
324323
final ArrayList<Object> cacheEntry = new ArrayList<Object>(8);
325324
for (;;) {
326325
Object cert = PEMInputOutput.readPEM(reader, null);

0 commit comments

Comments
 (0)