mirror of
https://github.com/TheOfficialFloW/bd-jb
synced 2024-11-28 11:42:22 -05:00
Improve bounds checking.
This commit is contained in:
parent
05adae5e31
commit
8d11f3545a
@ -89,7 +89,7 @@ public class Buffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkOffset(int offset, int length) {
|
private void checkOffset(int offset, int length) {
|
||||||
if (offset < 0 || (offset + length) > size) {
|
if (offset < 0 || length < 0 || (offset + length) > size) {
|
||||||
throw new IndexOutOfBoundsException();
|
throw new IndexOutOfBoundsException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user