Skip to content

Commit 5e80a8c

Browse files
committed
Arrays::getLength: include 'from' in exception message
Explicitly pass 'from' as String to the constructor of ByteBuffer to avoid interpreting it as initial buffer capacity. Signed-off-by: Josua Mayer <[email protected]>
1 parent 1d47f5c commit 5e80a8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: core/src/main/java/org/bouncycastle/util/Arrays.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ private static int getLength(int from, int to)
895895
int newLength = to - from;
896896
if (newLength < 0)
897897
{
898-
StringBuffer sb = new StringBuffer(from);
898+
StringBuffer sb = new StringBuffer(Integer.toString(from));
899899
sb.append(" > ").append(to);
900900
throw new IllegalArgumentException(sb.toString());
901901
}

0 commit comments

Comments
 (0)