Skip to content

Commit 8bfc24f

Browse files
committed
corrected length calculation
1 parent e94255b commit 8bfc24f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/org/bouncycastle/pqc/crypto/util/PrivateKeyFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,11 @@ private static int readLen(ByteArrayInputStream bIn)
502502
int length = bIn.read();
503503
if (length != (length & 0x7f))
504504
{
505-
int count = length;
505+
int count = length & 0x7f;
506506
length = 0;
507507
while (count-- != 0)
508508
{
509-
length = length << 8 + bIn.read();
509+
length = (length << 8) + bIn.read();
510510
}
511511
}
512512

0 commit comments

Comments
 (0)