Browse Source

Improve bounds checking.

master
Andy Nguyen 11 months ago
parent
commit
8d11f3545a
  1. 2
      src/com/bdjb/api/Buffer.java

2
src/com/bdjb/api/Buffer.java

@ -89,7 +89,7 @@ public class Buffer { @@ -89,7 +89,7 @@ public class Buffer {
}
private void checkOffset(int offset, int length) {
if (offset < 0 || (offset + length) > size) {
if (offset < 0 || length < 0 || (offset + length) > size) {
throw new IndexOutOfBoundsException();
}
}

Loading…
Cancel
Save