changeset 38584:96ea53771693

8158061: Additional argument checks to BasicImageReader calls Reviewed-by: alanb, coffeys
author jlaskey
date Fri, 27 May 2016 14:02:28 -0300
parents d887ee89eec0
children 4e6b93b00caa
files jdk/src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java	Fri May 27 08:52:22 2016 -0700
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java	Fri May 27 14:02:28 2016 -0300
@@ -57,14 +57,14 @@
     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++) {