mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-26 02:49:20 +00:00
8158061: Additional argument checks to BasicImageReader calls
Reviewed-by: alanb, coffeys
This commit is contained in:
parent
b9ff64a7cb
commit
74982b9113
@ -57,14 +57,14 @@ public class ImageStringsReader implements ImageStrings {
|
||||
private static int hashCode(byte[] bytes, int offset, int count, int seed) {
|
||||
Objects.requireNonNull(bytes);
|
||||
|
||||
if (offset < 0 || offset >= bytes.length) {
|
||||
throw new IndexOutOfBoundsException("offset");
|
||||
if (offset < 0 || count < 0 || offset > bytes.length - count) {
|
||||
throw new IndexOutOfBoundsException("offset=" + offset + ", count=" + count);
|
||||
}
|
||||
|
||||
int limit = offset + count;
|
||||
|
||||
if (limit < 0 || limit > bytes.length) {
|
||||
throw new IndexOutOfBoundsException("limit");
|
||||
throw new IndexOutOfBoundsException("limit=" + limit);
|
||||
}
|
||||
|
||||
for (int i = offset; i < limit; i++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user