Skip to content

Commit

Permalink
Arrays::getLength: include 'from' in exception message
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Artox committed Oct 7, 2017
1 parent 1d47f5c commit 5e80a8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/bouncycastle/util/Arrays.java
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ private static int getLength(int from, int to)
int newLength = to - from;
if (newLength < 0)
{
StringBuffer sb = new StringBuffer(from);
StringBuffer sb = new StringBuffer(Integer.toString(from));
sb.append(" > ").append(to);
throw new IllegalArgumentException(sb.toString());
}
Expand Down

0 comments on commit 5e80a8c

Please sign in to comment.